Skip to content

fix calendar showing previous day when using sliceMultiDayEvents#3555

Merged
khassel merged 2 commits into
MagicMirrorOrg:developfrom
MarcLandis:fix_calendar_slicemultidayevents
Sep 25, 2024
Merged

fix calendar showing previous day when using sliceMultiDayEvents#3555
khassel merged 2 commits into
MagicMirrorOrg:developfrom
MarcLandis:fix_calendar_slicemultidayevents

Conversation

@MarcLandis

Copy link
Copy Markdown
Contributor

This bug is caused by #3543.

The calculation for midnight adds a day but for endDate we want the day to be subtracted again.

@sdetweil

Copy link
Copy Markdown
Collaborator

do you have the test case that shows the prior failure

@MarcLandis

Copy link
Copy Markdown
Contributor Author

do you have the test case that shows the prior failure

I have the ics file. I you set the date to today it will show the previous day too.

slicemultiday.ics.txt

@sdetweil

Copy link
Copy Markdown
Collaborator

ok our test system allows specific day, not today, so set it to same day as testcase?

@MarcLandis

Copy link
Copy Markdown
Contributor Author

ok our test system allows specific day, not today, so set it to same day as testcase?

by today I meant 24th of September :)

@sdetweil

sdetweil commented Sep 24, 2024

Copy link
Copy Markdown
Collaborator

i understand, i have to set the testcase date to always sept 24, 2024

@sdetweil

Copy link
Copy Markdown
Collaborator

so the REAL problem is that there should be no event to process, but the RRULE handler retrurned one

24-09-24 15:41:07.987] [DEBUG] start: Mon Sep 23 2024 00:00:00 GMT+0100 (British Summer Time) 
[2024-09-24 15:41:07.987] [DEBUG] end:: Tue Sep 24 2024 00:00:00 GMT+0100 (British Summer Time) 
[2024-09-24 15:41:07.987] [DEBUG] duration: 86400000 
[2024-09-24 15:41:07.987] [DEBUG] title: 1 day repeat 
[2024-09-24 15:41:07.987] [DEBUG] fullday 
[2024-09-24 15:41:07.987] [DEBUG] pastLocal: Tue Sep 24 2024 00:00:01 GMT+0100 (British Summer Time) 
[2024-09-24 15:41:07.987] [DEBUG] futureLocal: Tue Sep 23 2025 23:59:59 GMT+0100 (British Summer Time) 
[2024-09-24 15:41:07.987] [DEBUG] Search for recurring events between: Tue Sep 24 2024 00:00:01 GMT+0100 (British Summer Time) and Tue Sep 23 2025 23:59:59 GMT+0100 (British Summer Time) 
[2024-09-24 15:41:07.987] [DEBUG] RRule: DTSTART:20240923T000000Z
RRULE:FREQ=YEARLY 
[2024-09-24 15:41:07.987] [DEBUG] Title: 1 day repeat, with dates: ["2024-09-23T00:00:00.000Z","2025-09-23T00:00:00.000Z"] 

@MarcLandis

Copy link
Copy Markdown
Contributor Author

For the "1 day repeat" event it shouldn't return it, but for the "2 days repeat" it should and the day in the past was shown too.

@sdetweil

Copy link
Copy Markdown
Collaborator

your fix is good.. can u update the changelog

This bug is caused by MagicMirrorOrg#3543.

The calculation for midnight adds a day but for endDate we want the day to be subtracted again.
@MarcLandis MarcLandis force-pushed the fix_calendar_slicemultidayevents branch from bfd9d71 to e83711a Compare September 25, 2024 06:11
@khassel khassel merged commit 2e6e868 into MagicMirrorOrg:develop Sep 25, 2024
@MarcLandis MarcLandis deleted the fix_calendar_slicemultidayevents branch September 25, 2024 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants