Open Zacqary opened 1 year ago
Having the same issue here. Did you resolve this somehow?
Also having this issue. I would like to get dates in UTC, no matter the local timezone.
Did anyone figure this out? Recurring events (MWF for example) created in timezones outside of the US (Asia/Singapore) are creating dates with the incorrect days (becomes SU, TU, TH)
In RRule 2.7.2 (but also reproduced as far back as 2.6.4), spin up a Jest environment and run the following:
The reason this is happening is because
before
seems to be calculating the recurrence time in the local system time, and then just plopping those raw values into a UTC date. Whenconsole.log
ingresult
:TZ=CET
:2023-02-25T00:00:00.000Z
(Feb 25 2023 at midnight, UTC)TZ=UTC
:2023-02-24T23:00:00.000Z
(Feb 24 2023 at 11pm, UTC)TZ=Asia/Taipei
:2023-02-25T07:00:00.000Z
(Feb 25 2023 at 7am, UTC)And the corresponding
getTime()
call results in different Unix timestamps. CallinggetTimezoneOffset()
also produces a non-zero offset when you run the test outside of UTC, in contrast to what the README indicates.Note that removing the tzid from the RRule does not help the situation