Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combining maxDaysToShow, maxEventCount and showNoEventDays does not work as expected #1247

Closed
2 tasks done
vandernorth opened this issue Oct 23, 2023 · 19 comments
Closed
2 tasks done
Labels

Comments

@vandernorth
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

image

Relevant config:

maxDaysToShow: 5
maxEventCount: 1 # would normally be more, but is better for this bug report
showNoEventDays: true
showHiddenText: true
noEventText: NO EVENTS
hiddenEventText: HIDDEN EVENTS

When combining these settings: Days that have events filtered out because it goes over the maxEventCount will show as "No events".

Expected behaviour

I would expect one of:

  1. These days not to be shown at all (because the settings is called MAXdaysToShow)
  2. These days to show HIDDEN EVENTS

I would prefer option 1.

Steps To Reproduce

v9.1.0 on HASS 2023.10.0

Use the above config to reproduce, play with maxEventCount a bit.

Mode

Event (default)

Card Version

9.1.0

Home Assistant Version

2023.10.0

Configuration

maxDaysToShow: 5
maxEventCount: 1
showNoEventDays: true
showHiddenText: true
noEventText: NO EVENTS
hiddenEventText: HIDDEN EVENTS

Relevant log output

None

Code of Conduct

  • I agree to follow this project's Code of Conduct
@vandernorth vandernorth added the type/bug Something isn't working label Oct 23, 2023
@github-actions
Copy link

Hello @vandernorth, thank you for your interest in our work!
If this is a bug report, please provide your configuration and any screenshots that would assist troubleshooting, otherwise we can not help you.

@vandernorth
Copy link
Author

I did.

@Tosko4
Copy link

Tosko4 commented Nov 11, 2023

I have the same issue, when I say maxDaysToShow: 14 the list is quite long, when i combine it with maxEventCount: 8, it does not show the calendar items of tomorrow.

@dave-dube
Copy link

Same issue on my side. I'm using it with 3 calendars (each has several events), and when using maxDaysToShow +maxEventCount it doesn't show right events. It shows the right number of event according the maxEventCount setting (eg: 10), but those 10 event are only considering "all day events" from 18 days ahead.. weird. Like a wrong sorting action is done prior to filter out events exceeding the maxEventCount. So for now. no choice to stop using maxEventCount because my dashboard skip a lot of events.

@johnekarlsson
Copy link

Same issue for me. The more I increase maxDaysToShow, the more events are skipped, (although always considering the maxEventCount). The selection of what events are shown is not chronological, as expected, but seemingly random.

@marksie1988
Copy link
Collaborator

Ok so the hidden event text not showing was due to it accidentally being removed at some point when code was re-structured. I have now added that back in so at least you know events are hidden. the issue with the way hidden events is calculated is that its not per day, it counts the total events that were removed from the list of events when limits are applied. This means that although it will tell you x events hidden it wont tell you how many on which day.

I could look at modifying the "No Events" so that it doesnt show when there are hidden events?

@marksie1988
Copy link
Collaborator

I have released a new beta that fixes the hidden events text v9.2.1-beta.3

@johnekarlsson
Copy link

Hi! I have updated to beta.4 now and the issue still persists of seemingly random events being hidden. I'd be glad to assist in troubleshooting or answering questions if there are any!

@marksie1988
Copy link
Collaborator

@johnekarlsson do you have a copy of your config so I can check if it's something specific with the way you have the config.

I'm not sure why the events hidden would be random as it takes the current day + startDaysAhead + maxDaysToShow it then pulls all the events between this sorts them in the order selected and then removes X number of events from the bottom of the list.

As it removes the events at the end it should always be consistent. The only thing that would amend this is if an event finished as then it would be moved to the end of the list which would mean it would be hidden and one of the events that hasn't finished would be shown.

@johnekarlsson
Copy link

Here you go!

With the config below I get these events:
image

But if I remove "maxDaysToShow: 30" I can now see three events that were hidden before (two the 15th and one the 17th).

image
type: custom:atomic-calendar-revive
entities:
  - entity: calendar.xxxxxx
    titleColor: red
name: null
enableModeChange: true
firstDayOfWeek: 1
maxDaysToShow: 30
showNoEventsForToday: false
showLastCalendarWeek: false
showProgressBar: false
disableLocationLink: false
showFullDayProgress: false
europeanDate: true
showEventIcon: false
showHiddenText: false
showLoader: false
showDate: false
sortByStartTime: false
hideFinishedEvents: true
showLocation: false
showRelativeTime: false
fullDayEventText: Hela dagen
untilText: till
noEventsForNextDaysText: Inga aktiviteter de kommande dagarna
noEventText: Inga aktiviteter idag
calShowDescription: false
disableCalEventLink: true
disableCalLocationLink: true
disableCalLink: true
dimFinishedEvents: true
disableEventLink: true
showWeekDay: false
language: sv
showMonth: true
showCurrentEventLine: false
maxEventCount: 6

@marksie1988
Copy link
Collaborator

Ok thanks I'll do some testing tomorrow,

How many events are on each of those days? And are there any full day events or are they all timed events?

This will allow me to totally replicate your expected view Vs the incorrect view.

marksie1988 added a commit that referenced this issue Jan 13, 2024
github-actions bot pushed a commit that referenced this issue Jan 13, 2024
## [9.3.0-beta.1](v9.2.1-beta.4...v9.3.0-beta.1) (2024-01-13)

### Features

* **lang:** add Czech ([47d284e](47d284e)), closes [#1363](#1363)

### Bug Fixes

* entity.maxDaysToShow was not applying ([16b7fbb](16b7fbb)), closes [#1255](#1255) [#1247](#1247)
github-actions bot pushed a commit that referenced this issue Jan 13, 2024
## [9.3.0](v9.2.1...v9.3.0) (2024-01-13)

### Features

* **lang:** add Czech ([47d284e](47d284e)), closes [#1363](#1363)

### Bug Fixes

* bug introduced when fixing hidden event text ([ee8d280](ee8d280))
* entity.maxDaysToShow was not applying ([16b7fbb](16b7fbb)), closes [#1255](#1255) [#1247](#1247)
* hidden events text was not showing up ([844f98b](844f98b))
* localized dates not showing as expected when using LL etc ([432f0f2](432f0f2)), closes [#1334](#1334)
* **sortby:** hopefully actually resolves sortby this time! ([cdf06f3](cdf06f3)), closes [#1258](#1258)
* **sortby:** resolves issue with sorting of events ([051d2ca](051d2ca)), closes [#1258](#1258)
@vandernorth
Copy link
Author

Using v9.4.0 the issue seems to be resolved. at least for what is was trying to do.
johnekarlsson everything working on your end as well?

@johnekarlsson
Copy link

Hi,

I still have a problem, but I suspect it's more related to #1378. In any case, it's a bit har for me to troubleshoot this when #1378 is still open.

The following is tested using 9.4.0 Beta 2

This code:

type: custom:atomic-calendar-revive
entities:
  - entity: calendar.xxx
maxDaysToShow: 30

...gives this result (works as expected):
image

But if I add:
maxEventCount: 6

...many events are hidden that shouldn't be:
image

@marksie1988
Copy link
Collaborator

I'm working on a fix after I realised what I was doing wrong...

The all day events were being placed at the begining of the array, but the regular events on the same dates were being pushed down.

I'm now reworking the logic so that each day is sorted individually and then all merged into one at the end which should solve this.

github-actions bot pushed a commit that referenced this issue Jan 23, 2024
## [9.4.0-beta.3](v9.4.0-beta.2...v9.4.0-beta.3) (2024-01-23)

### Bug Fixes

* **sort:** events were not sorting correctly with allday and regular events ([cc9f23b](cc9f23b)), closes [#1378](#1378) [#1247](#1247)
Copy link

🎉 This issue has been resolved in version 9.4.0-beta.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@marksie1988
Copy link
Collaborator

Hopefully this latest release resolves issues with sorting, there is still an issue with milestone sorting but that will be more complex to resolve

@johnekarlsson
Copy link

johnekarlsson commented Jan 23, 2024 via email

github-actions bot pushed a commit that referenced this issue Jan 27, 2024
## [9.5.0-beta.1](v9.4.0...v9.5.0-beta.1) (2024-01-27)

### Features

* Add Catalan Language ([b0ba9ee](b0ba9ee))
* add Slovak language file ([7d4ff97](7d4ff97))

### Bug Fixes

* **sort:** events were not sorting correctly with allday and regular events ([cc9f23b](cc9f23b)), closes [#1378](#1378) [#1247](#1247)
* **sorting:** events from multiple calendars were not sorted by date first ([1af1c2e](1af1c2e)), closes [#1378](#1378)
Copy link

🎉 This issue has been resolved in version 9.5.0-beta.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this issue Jan 28, 2024
## [9.5.0](v9.4.0...v9.5.0) (2024-01-28)

### Features

* add ... to title length when trimmed ([81bfd5b](81bfd5b)), closes [#1399](#1399)
* Add Catalan Language ([b0ba9ee](b0ba9ee))
* add Slovak language file ([7d4ff97](7d4ff97))

### Bug Fixes

* **sort:** events were not sorting correctly with allday and regular events ([cc9f23b](cc9f23b)), closes [#1378](#1378) [#1247](#1247)
* **sorting:** events from multiple calendars were not sorted by date first ([1af1c2e](1af1c2e)), closes [#1378](#1378)
Copy link

🎉 This issue has been resolved in version 9.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants