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

full day repeating rule event east of utc get initial date wrong. #36

Closed
sdetweil opened this issue Oct 20, 2020 · 1 comment · Fixed by #42
Closed

full day repeating rule event east of utc get initial date wrong. #36

sdetweil opened this issue Oct 20, 2020 · 1 comment · Fixed by #42

Comments

@sdetweil
Copy link
Contributor

seems rrule and luxon disagree on date format rrule for UTC and Luxon for local time

@sdetweil
Copy link
Contributor Author

while fixing the timezone, we have a side effect,,, for date only, it stores the date in local UTC TZ format

    // No TZ info - assume same timezone as this computer
    newDate = new Date(comps[1], parseInt(comps[2], 10) - 1, comps[3]);
BEGIN:VCALENDAR
BEGIN:VEVENT
DTSTART;VALUE=DATE:20201019
DTEND;VALUE=DATE:20201020
RRULE:FREQ=WEEKLY;WKST=MO;UNTIL=20201231T000000Z;INTERVAL=2;BYDAY=MO
DTSTAMP:20201019T185436Z
UID:cco68e1o6sp32b9o74r30b9k6ti36bb174sjgb9k6dijgdr665j3adph74@google.com
CREATED:20201019T185320Z
DESCRIPTION:
LAST-MODIFIED:20201019T185320Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Test
TRANSP:TRANSPARENT
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:This is an event reminder
TRIGGER:-P0DT4H0M0S
END:VALARM
END:VEVENT
END:VCALENDAR

stored as


[2020-10-20 15:35:34.681] [LOG]    ical parse returning {"cco68e1o6sp32b9o74r30b9k6ti36bb174sjgb9k6dijgdr665j3adph74@google.com":{"type":"VEVENT","params":[],**"start":"2020-10-19T05:00:00.000Z"**,"datetype":"date","end":"2020-10-20T05:00:00.000Z","rrule":{"_cache":{"all":false,"before":[],"after":[],"between":[]},"origOptions":{"dtstart":"2020-10-19T05:00:00.000Z","freq":2,"wkst":{"weekday":0},"until":"2020-12-31T00:00:00.000Z","interval":2,"byweekday":[{"weekday":0}]},"options":{"freq":2,"dtstart":"2020-10-19T05:00:00.000Z","interval":2,"wkst":0,"count":null,"until":"2020-12-31T00:00:00.000Z","bysetpos":null,"bymonth":null,"bymonthday":[],"bynmonthday":[],"byyearday":null,"byweekno":null,"byweekday":[0],"bynweekday":null,"byhour":[5],"byminute":[0],"bysecond":[0],"byeaster":null}},"dtstamp":"2020-10-19T18:54:36.000Z","uid":"cco68e1o6sp32b9o74r30b9k6ti36bb174sjgb9k6dijgdr665j3adph74@google.com","created":"2020-10-19T18:53:20.000Z","description":"","lastmodified":"2020-10-19T18:53:20.000Z","location":"","sequence":"0","status":"CONFIRMED","summary":"Test","transparency":"TRANSPARENT","863f0fb6-8d51-4b3f-92a8-d7d9264b47c3":{"type":"VALARM","params":[],"action":"DISPLAY","description":"This is an event reminder","trigger":"-P0DT4H0M0S"}}}

if the current timezone is -offset (east of london), then the time will be (2 2 hour offset)
"start":"2020-10-18T05:22:00.000Z"

luxon expects 2020-10-19, actual local time..

so, two problems..

later when we calc start date of repeating rule, we are checking for length === 8, but it is stored in utc format

then the the date value passed is incorrect for luxon...
RRULE has an open PR to fix this jkbrzt/rrule#404

we can work around without impact.. if the time is 12:00:00 AM, and then offset is east, add the offset to the stored time to get actual local time as start

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