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

Single-day Event list shows all-day events for following day #1610

Open
2 tasks done
dml105 opened this issue Jan 27, 2025 · 3 comments
Open
2 tasks done

Single-day Event list shows all-day events for following day #1610

dml105 opened this issue Jan 27, 2025 · 3 comments
Labels
type/bug Something isn't working

Comments

@dml105
Copy link

dml105 commented Jan 27, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have a set of ACR cards, each displaying exactly one day of events, with varying offsets.

As an example, this results in correctly presenting an event for Wed Jan 29 (an event from 6-9pm) but also incorrectly presents the whole day event for Thu Jan 30.

Image

That event on Thu Jan 30 should not appear on a 1 day event list.

Expected behaviour

Image

Steps To Reproduce

For example:

type: custom:atomic-calendar-revive
name: Calendar
enableModeChange: true
entities:
  - entity: calendar.school_calendar
    name: School
  - entity: calendar.family_calendar
    name: Family calendar
  - entity: calendar.Mom
    name: Mom
  - entity: calendar.Dad
    name: Dad
maxDaysToShow: 1
startDaysAhead: 3

Note: these are ICS calendars using the CALDAV integration. It appears the problem does not occur with calendars from the Google Calendar integration.

Mode

Event (default)

Card Version

10.0.0

Home Assistant Version

2014.12.3

Configuration

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct
@dml105 dml105 added the type/bug Something isn't working label Jan 27, 2025
Copy link

Hello @dml105, 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.

@dml105
Copy link
Author

dml105 commented Jan 28, 2025

Seems like the problem is here, in src/index.ts around lines 353-359:

const htmlEvents = dayEvents.map((event: EventClass, i, arr) => {
				const dayWrap = i == 0 && di > 0 ? 'daywrap' : '';
				const isEventNext = !!(
					di == 0 &&
					event.startDateTime.isAfter(dayjs()) &&
					(i == 0 || !arr[i - 1].startDateTime.isAfter(dayjs()))
				);

does this need an extra AND for event.startDateTime.isAfter(dayjs()+1) && ?

@dml105
Copy link
Author

dml105 commented Jan 28, 2025

Until this is fixed, you can use card_mod to hide the all-day events that should be in the next day with this CSS, assuming you display your all-day events first, and not at the bottom:

card_mod:
  style: |
    .cal-eventContainer {
      .single-event-container~.daywrap {
         display: none !important;
      }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant