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 returns null after being passed a valid Date object #640

Open
7 tasks done
dopatraman opened this issue Oct 1, 2024 · 0 comments
Open
7 tasks done

rrule.after returns null after being passed a valid Date object #640

dopatraman opened this issue Oct 1, 2024 · 0 comments

Comments

@dopatraman
Copy link

const { RRule, datetime } = require('rrule');
const rRule = RRule.fromString("DTSTART:20240711T000000Z\nRRULE:FREQ=YEARLY;INTERVAL=1;COUNT=1")

// Given this date:
const dd = new Date('2024-07-11 00:00:00'); // 2024-07-11T07:00:00.000Z

// and this rrule datetime
const dt = datetime(dd.getYear(), dd.getMonth(), dd.getDay()); // 2024-07-11T07:00:00.000Z

If I call rRule.after(dt) i get null:

rRule.after(dt) // null

Why? As far as I can tell this is how the function is meant to be used. The expected output would be 1 year into the future, based on the recurrence string.

RRULE version: 2.8.1
OS: MacOS Sonoma
Timezone: Tue Oct 1 15:24:16 PDT 2024

Reporting an issue

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

  • 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.
  • Expected output
  • Actual output
  • The version of rrule you are using
  • Your operating system
  • Your local timezone (run $ date from the command line
    of the machine showing the bug)
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