-
Notifications
You must be signed in to change notification settings - Fork 115
RRule object is not initialized with dtstart #21
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
Comments
Failing test case here : https://github.com/LionelMartin/ical.js/commit/a32a747900dddba64d65f46e8591521de62bfbaf#test |
Same problem here. |
I believe this was fixed by #48 - can you run your test and confirm? I'd love to add the test to the suite if this solves it. |
Works for me, but personally I don't like "hack" used in ical addTZ() fill fill optinal "RRule" with DTSTART value
I also stumbled across this one and made some changes, which work for me. From my point of view this is still a hack, as I don't like the changes I've made in ical.js/addTZ(..). Maybe somebody has a better idea, how to implement it. |
I ran across this problem also. The fix for #48 does not completely fix #21 - in that ev.rrule.between() does not seem to work properly... even though rrule.options.dtstart seems to be set, it's not being honored. (Perhaps ev.rrule.origOptions is being used instead?) I independently developed my own fix, which is shown below. This code fixes the problems that I was experiencing, but potentially suffers the same deficiency that @Angus71 noted, namely that if "DTSTART" comes after the "RRULE", then it should not work. (and if RRULE includes a DTSTART field it will be overwritten, although this is easily fixed.) ical.objectHandlers['RRULE'] = function(val, params, curr, stack, line){
var rule = line.replace("RRULE:", "");
rule += ";DTSTART="+curr.start.toISOString().replace(/[-:]/g,'');
rule = rule.replace(/\.[0-9]{3}/, "");
curr['rrule'] = rrule.fromString(rule);
return curr
} |
The DTSTART/RRULE sequencing issue noted by @Angus71 (and later me) should probably be fixed by moving the code that patches up the RRULE with a default start date into the objectHandler for 'END'. I'll try this tonight. |
@risacher Any luck fixing this? |
When accessing the rrule of an event, the dtstart of the rrule is not set, so I had to do this:
Only then could I safely use the rrule
The text was updated successfully, but these errors were encountered: