-
-
Notifications
You must be signed in to change notification settings - Fork 515
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
Bugfix #91
Bugfix #91
Conversation
Problem is that in options.wkst is kept a number and not a Weekday object. Therefore if wkst is set then we get wrong RFC string with 'WKST=0' when it should be 'WKST=MO' which makes parsedString = RRule.optionsToString(options) not parseable to RRule object again with RRule.fromString(parsedString) cause at line :1415 we have such assignment - options.wkst = RRule[value]; - value === 0 in that instead of 'MO' and problem is that RRule[0] is non existent. And that makes code at line :520 accessible and it raises an Exception (TypeError: Cannot read property 'weekday' of undefined) as nor Weekday nor number nor null is stored in opts.wkst.
Fixed WKST conversion to string
Thanks! |
I've had to undo this change as it was throwing exceptions. Could you please provide an example where |
var rrule = RRule.fromString('FREQ=WEEKLY;DTSTART=20110201T093000Z;INTERVAL=5;UNTIL=20130130T230000Z;BYDAY=MO,FR'); RRule.optionsToString(rrule.options); // and you get in the string WKST=0, and it ain't valid iCal option, you cannot parse it back to RRule object |
Please read the documentation on var rrule = RRule.fromString('FREQ=WEEKLY;DTSTART=20110201T093000Z;INTERVAL=5;UNTIL=20130130T230000Z;BYDAY=MO,FR');
rrule.toString()
"FREQ=WEEKLY;DTSTART=20110201T093000Z;INTERVAL=5;UNTIL=20130130T230000Z;BYDAY=MO,FR"
rrule.origOptions.byweekday
[Weekday, Weekday]
rrule.origOptions.byweekday.toString()
"MO,FR"
rrule.origOptions.byweekday[0].toString()
"MO" |
The (documented) inconsistency regarding |
# By Linquize (2) and others # Via Jakub Roztočil (4) and Jakub Roztocil (2) * 'master' of https://github.com/jakubroztocil/rrule: Undo jkbrzt#91 as it was breaking the demo app Allow Negative and 2-Digit Values in Demo Bugfix Fix typo Do not hang if interval is 0 or not a number Updating script location in Bower, fixes jkbrzt#61.
Problem is that in options.wkst is kept a number and not a Weekday object. Therefore if wkst is set then we get wrong RFC string with 'WKST=0' when it should be 'WKST=MO' which makes parsedString = RRule.optionsToString(options) not parseable to RRule object again with RRule.fromString(parsedString) cause at line :1415 we have such assignment - options.wkst = RRule[value]; - value === 0 in that instead of 'MO' and problem is that RRule[0] is non existent. And that makes code at line :520 accessible and it raises an Exception (TypeError: Cannot read property 'weekday' of undefined) as nor Weekday nor number nor null is stored in opts.wkst.