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

First and Last Occurence Calculation only considers the first VEvent-Block #1512

Open
kesslerd opened this issue Nov 14, 2023 · 2 comments
Open
Assignees

Comments

@kesslerd
Copy link

When I create a recurring event and move the first event to the day before the calendarobject-record still has the same firstoccurence as before.

When I look at the code it seems that https://github.com/sabre-io/dav/blob/master/lib/CalDAV/Backend/PDO.php#L625 does only use the first VEvent Component it finds for the calculation

This means that exceptional events that are stored in the same Calendarobject will not be found when we do a time range search for the exact day the exception takes place and the exception is not inside the range of the main recurring event range

@phil-davis
Copy link
Contributor

@kesslerd can you give a specific example that illustrates the problem.
If possible, make a PR with a new unit test case that has the example and fails. Then I can more reliably make sure that I really fix what you are describing.
Even better, also add code changes that make the unit test pass!

@kesslerd
Copy link
Author

kesslerd commented Jan 7, 2024

Hi @phil-davis

I created a recurrent event from the 3rd of January until the 10th of January from 11:30 until 11:45.
After that I moved the first entry in the event series to the 2nd of January

The calculated first occurence is 1704281400 which would still be the 3rd of January.

BEGIN:VCALENDAR
PRODID:-//iCal4j Connector//EN
VERSION:2.0
CALSCALE:GREGORIAN
BEGIN:VEVENT
DTSTAMP:20240107T190324Z
UID:366a8e08-b2fc-431b-b2b1-07f6ede91585
DTSTART:20240103T113000
DTEND:20240103T114500
RRULE:FREQ=DAILY;WKST=MO;UNTIL=20240110T225900Z;INTERVAL=1
SUMMARY:test
DESCRIPTION:
CLASS:PUBLIC
STATUS:CONFIRMED
TRANSP:OPAQUE
SEQUENCE:2
END:VEVENT
BEGIN:VEVENT
DTSTAMP:20240107T190324Z
UID:366a8e08-b2fc-431b-b2b1-07f6ede91585
RECURRENCE-ID:20240103T113000
DTSTART:20240102T113000
DTEND:20240102T114500
SUMMARY:test
DESCRIPTION:
CLASS:PUBLIC
STATUS:CONFIRMED
TRANSP:OPAQUE
SEQUENCE:0
END:VEVENT
END:VCALENDAR

This event has two VEvents entries, but the getDenormalizedData Method only looks at the first VEvent block it finds and uses the DSTART Property and does not consider any further blocks.

Maybe the method can loop through each VEvent-Block to find the min firstOccurence and max lastOccurence.

I hope this helps you to work on the issue.

@phil-davis phil-davis self-assigned this Jan 8, 2024
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

No branches or pull requests

2 participants