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

Occurences are wrong when DTStart includes timezone #611

Open
7 tasks done
Reeywhaar opened this issue Dec 22, 2023 · 0 comments
Open
7 tasks done

Occurences are wrong when DTStart includes timezone #611

Reeywhaar opened this issue Dec 22, 2023 · 0 comments

Comments

@Reeywhaar
Copy link

Reporting an issue

Given that we have:

const rule = RRule.fromString(
  `
DTSTART;TZID=America/Montreal:20111002T090000
RRULE:FREQ=WEEKLY
`.trim()
);

And then we want to find occurences:

rule
    .between(
      moment("2020-11-02T00:00:00+00:00").toDate(),
      moment("2020-12-09T00:00:00+00:00").toDate()
    )
    .map((o) => moment(o).clone().tz("Europe/London").format())
    .join("<br/>")

We get results that are off by timezone offset. America/Montreal is ~ -04:00. Europe/London is +00:00. Why do we get result that has offset of 8 hours between rrule initial timezone?

  • Verify that you've looked through existing issues for duplicates before
    creating a new one
  • Code sample reproducing the issue. Be sure to include all input values you
    are using such as the exact RRule string and dates.
    https://codesandbox.io/p/sandbox/floral-cherry-53htrz?file=%2Fsrc%2Findex.ts%3A13%2C27
  • Expected output
    2020-11-08T13:00:00Z
    2020-11-15T13:00:00Z
    2020-11-22T13:00:00Z
    2020-11-29T13:00:00Z
    2020-12-06T13:00:00Z
  • Actual output
    2020-11-08T17:00:00Z
    2020-11-15T17:00:00Z
    2020-11-22T17:00:00Z
    2020-11-29T17:00:00Z
    2020-12-06T17:00:00Z
  • The version of rrule you are using
    2.8.1
  • Your operating system
    MacOS Sonoma
  • Your local timezone (run $ date from the command line
    of the machine showing the bug)
    Europe/Istanbul
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

1 participant