This works:
var options = {"freq":"1", "byweekday":RRule.TU};
var rule = new RRule(options);
console.log(rule.toText());
This does not work:
var options = {"freq":"1", "byweekday":1};
var rule = new RRule(options);
console.log(rule.toText());
When calling rule.toText()
the following exception is thrown:
Uncaught TypeError: wday.getJsWeekday is not a function
+1 im still seeing this bug
I've just hit the same issue as well @michaelkrog is your fix suitable for a pull request into the main library?
(I appreciate this is quite an old issue for you at this point and you've probably moved on to other things!!)
+1 I'm facing the same issue.
Same issue here!
+1 still an issue: Uncaught TypeError: wday.getJsWeekday is not a function
Seems like there's activity again, maybe this will get fixed??
I found a way to work around this:
var myrule = {freq: RRule.weekly, byweekday: [1,2,3]}
// myrule.toText() -- this crashes.
var myrule2 = rrulestr(myrule.toString());
// myrule2.toText() -- this works.
It's a crappy solution though.
This appears fixed as of 2.3.4
I got this error today until I converted the array of WeekdayStr into ints
@strass Yes, effectively we need to use Weekday.fromStr(your string)
Most helpful comment
I got this error today until I converted the array of WeekdayStr into ints