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

byweekday undefined has different behavior than empty array #598

Open
7 tasks done
SinBirb opened this issue Sep 15, 2023 · 0 comments
Open
7 tasks done

byweekday undefined has different behavior than empty array #598

SinBirb opened this issue Sep 15, 2023 · 0 comments

Comments

@SinBirb
Copy link

SinBirb commented Sep 15, 2023

If this is expected behavior, please document it. However, I would expect an empty array to be treated the same way as not giving the option or at least .count() being 0. But if byweekday == [], then all days are in the rrule, which is definitely not obvious.

  • 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.
const dtstart = new Date(Date.UTC(2023, 8, 15, 3, 0, 0));
const until = new Date(Date.UTC(2023, 8, 22, 3, 0, 0));
const rule1 = new RRule({
    freq: RRule.WEEKLY,
    dtstart,
    until,
    interval: 1,
    byweekday: []
});
const rule2 = new RRule({
    freq: RRule.WEEKLY,
    dtstart,
    until,
    interval: 1
});
console.log(rule2.count() == rule1.count());
  • Expected output
    true
  • Actual output
    false
  • The version of rrule you are using
    2.7.1
  • Your operating system
    Arch Linux
  • Your local timezone (run $ date from the command line
    of the machine showing the bug)
    CEST
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