-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
DST ignored on creation of RRule date using between() #260
Comments
Hello, Can you please tell how I can incorporate this code in this example ? |
the problem is not node-ical. it is rrule.
|
I don't agree that it's an issue with the RRULE. The calendar events are being utilized in GMT time rather than UTC time. Consequently, if an event is created during daylight saving time, it will be considered in the example underneath as GMT+02:00 rather than UTC+01:00. Example: |
This is an event from my iCloud Calender. I Removed the X-APPLE stuff and anonymized it.
This is the object await ical.async.fromURL(calendarUrlHttp) creates:
It gets the Date created correct: And it gets the start of the event correct, as it normalizes it to UTC and remembers the original Timezone: Now I run
The Result is And this is not correct. These dates would be correct for DST but not on the 5th of January. The correct Z dates would be I now fix this by
Now I have the correct date. Soo... either I have a bug in the implementation or the module has one. BR Jan |
Jan, your problem might be a bit different from mine, even though they both relate to daylight saving time. If you perform a parseFile using my example, you will obtain the underneath object. As you can observe, the time has shifted from 12:30 (Europe/Brussels) to 10:30 UTC, rather than 11:30 UTC. Probably caused by "TZOFFSETTO:+0200" in the VTIMEZONE part. From the example: Object created: |
Below is the VTIMEZONE from my calendar... What a P.I.T.A. file format... What I noticed is that there are several entries for DAYLIGHT and STANDARD It seems that Apple is storing the complete history of all definitions of all timezones used in the calendar. MAYBE this causes an issue. For Germany, from Wikipedia:
|
node-ical does not process the vtimezone records |
I noticed that node-ical is not correctly handling timezones in recurring events. When using
Assume an event is created in the calendar in the "winter" time:
I used the between method to get the dates based on the rule from now to an end date.
the (stringified) result was
startDates = ["2023-03-24T07:00:00.000Z","2023-03-27T07:00:00.000Z","2023-03-28T07:00:00.000Z","2023-03-29T07:00:00.000Z"]
As you can see, the UTC date on the 24th was good as it was at 08:00 Local time.
However the dates for the 27th is not good as it moves the local event to 07:00. The anchor point should be the timezone of the original creation.
As a workaround, I wrote a function to correct the dates.
The text was updated successfully, but these errors were encountered: