You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have tried switching from UTC based RRule interval generation to a timezone based as it handles some edge cases, however, while doing the move, I noticed that the first time interval is different.
import{Frequency,RRule,Options}from"rrule";process.env.TZ='UTC';consttoDate=`2024-05-14 06:59:59.999+00`;// corresponds with end-of-day in America/Los_Angeles timezoneconstfrequencyRuleWithTz: Options={tzid: 'America/Los_Angeles',byhour: 5,count: 1,dtstart: newDate(toDate),freq: Frequency.DAILY,}asany;constfrequencyRuleOld: Options={tzid: 'UTC',byhour: 12,count: 1,dtstart: newDate(toDate),freq: Frequency.DAILY,}asany;letrrule=newRRule(frequencyRuleWithTzasany);for(constdateofrrule.all()){console.log("America/Los_Angeles");console.log(date.toISOString());}rrule=newRRule(frequencyRuleOldasany);for(constdateofrrule.all()){console.log("UTC");console.log(date.toISOString());}
Output:
America/Los_Angeles
2024-05-15T12:00:00.999Z
UTC
2024-05-14T12:00:00.999Z
the reason why I expected it would be a seemless migration is because UTC 12 PM <=> LA 5 AM (excluding daylight savings), but instead, the 1st iteration is a day after.
this is the value I expected while providing frequencyRuleWithTz
2024-05-14T12:00:00.999Z
I am not sure if that's the expected behavior, but on this case - it does seem like a bug.
The version of rrule you are using [2.8.1, also reproduced using 2.7.0]
Your operating system [ macOS ]
Your local timezone (run $ date from the command line
of the machine showing the bug) [ node process is UTC ]
The text was updated successfully, but these errors were encountered:
Reporting an issue
Hi,
I have tried switching from UTC based RRule interval generation to a timezone based as it handles some edge cases, however, while doing the move, I noticed that the first time interval is different.
Output:
the reason why I expected it would be a seemless migration is because UTC 12 PM <=> LA 5 AM (excluding daylight savings), but instead, the 1st iteration is a day after.
this is the value I expected while providing
frequencyRuleWithTz
I am not sure if that's the expected behavior, but on this case - it does seem like a bug.
rrule
you are using [2.8.1, also reproduced using 2.7.0]$ date
from the command lineof the machine showing the bug) [ node process is UTC ]
The text was updated successfully, but these errors were encountered: