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

rrule.after method doesn't work if there is a TZID in the dtstart #608

Open
1 task done
Remmelt13 opened this issue Nov 20, 2023 · 1 comment
Open
1 task done

Comments

@Remmelt13
Copy link

Remmelt13 commented Nov 20, 2023

Reporting an issue

The new version >2.7.2 breaks the after method if the rrule string includes a tzid. timezone on the machine is CET. It is also happening on the demo app setting tzid breaks the output of rrule.all()

Code:
const date = new Date() const rrule = "DTSTART;TZID=Europe/Berlin:20231120T110012\nRRULE:FREQ=DAILY;INTERVAL=1" const tempRule = rrulestr(rrule); const nextOccurrence = tempRule.after(date, true)

Stack trace
RangeError: Invalid time zone specified: Etc/Unknown at Date.toLocaleString (<anonymous>) at dateTZtoISO8601 (/Users/rem_h1/Upwell/invoice-app/node_modules/rrule/dist/es5/webpack:/rrule/src/dateutil.ts:207:24) at tzOffset (/Users/rem_h1/Upwell/invoice-app/node_modules/rrule/dist/es5/webpack:/rrule/src/dateutil.ts:215:34) at t2.rezonedDate (/Users/rem_h1/Upwell/invoice-app/node_modules/rrule/dist/es5/webpack:/rrule/src/dateutil.ts:219:36) at rezoneIfNeeded (/Users/rem_h1/Upwell/invoice-app/node_modules/rrule/dist/es5/webpack:/rrule/src/iter/index.ts:152:47) at iter (/Users/rem_h1/Upwell/invoice-app/node_modules/rrule/dist/es5/webpack:/rrule/src/iter/index.ts:78:33) at t2._iter (/Users/rem_h1/Upwell/invoice-app/node_modules/rrule/dist/es5/webpack:/rrule/src/rrule.ts:129:12) at t2.after (/Users/rem_h1/Upwell/invoice-app/node_modules/rrule/dist/es5/webpack:/rrule/src/rrule.ts:234:21)

Thank you for taking an interest in rrule! Please include the following in
your report:

  • [x ] Verify that you've looked through existing issues for duplicates before
    creating a new one
  • [ x] Code sample reproducing the issue. Be sure to include all input values you
    are using such as the exact RRule string and dates.
  • Expected output
  • [ x] Actual output
  • [ x] The version of rrule you are using
  • [ x] Your operating system
  • [ x] Your local timezone (run $ date from the command line
    of the machine showing the bug)
@Remmelt13 Remmelt13 changed the title .after method doesn't work if there is a TZID in the dtstart rrule.after method doesn't work if there is a TZID in the dtstart Nov 20, 2023
@KrisLau
Copy link

KrisLau commented Dec 11, 2023

Having the same issue. My logs:

LOG  recurrenceRule
LOG  DTSTART;TZID=America/Chicago:20231211T023500
RRULE:FREQ=WEEKLY;INTERVAL=1;BYDAY=MO,WE,FR;UNTIL=20231218T023500
LOG  RRule.fromString(recurrenceRule).all()
LOG  [Date { NaN }, Date { NaN }, Date { NaN }, Date { NaN }]

jens-maus added a commit to 50an6xy06r6n/node-ical that referenced this issue Sep 2, 2024
jens-maus added a commit to jens-maus/node-ical that referenced this issue Sep 2, 2024
* note: test cases on windows with rrule.between are skipped since rrule seems to be somewhat broken (cf.
jkbrzt/rrule#608)

Co-authored-by: Jens Maus <mail@jens-maus.de>
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

2 participants