Open JeffBaumgardt opened 4 years ago
I encounter the same problem. When using fromString('RRULE:FREQ=WEEKLY;INTERVAL=1;WKST=MO')
returned object contains byweekday: [6]
which is Sunday (today day). It should not fill byweekday with any value.
Just discovered this today when trying to fromString a weekly rule interval 1. Workaround is to test the string prior, and add an empty array to get around the parseOptions code that adds the byweekday value.
var roptions = RRule.parseString(val)
if (val.indexOf("FREQ=WEEKLY") > 0 && val.indexOf("BYDAY") == -1) {
roptions.byweekday = []
}
var rrule = new RRule(roptions)
When parsing a rule string using
RRule.fromString
an incorrect option is being returned.[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.
[x] Expected output
[x] Actual output
[x] The version of
rrule
you are using[x] Your operating system
[ ] Your local timezone (run
$ date
from the command line of the machine showing the bug) - Inapplicablerrule version:
2.6.4
Operating System:
Windows 10
Code Sandbox: https://codesandbox.io/s/silly-rosalind-7fwnn
When using a simple recurrence of
RRULE:FREQ=WEEKLY
I would expect the byweekday array in the options to be empty. However, it appears to populate with a random weekday number.Please see console output for json objects
I have also tested with byday
FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR,SA
and these are correctly listed. It's just when there is no BYDAY option in the string that's causing the issue.