-
-
Notifications
You must be signed in to change notification settings - Fork 519
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
First iteration not generated if local time is before iteration time #369
Comments
@RonyDimebag i am running into a similar issue. Do you have any solution to this? |
@pitops unfortunately not. The only idea I had for a solution was to uniquely check for such an exception and deal with it privately (manually add an instance), but it's too messy and I don't know what other exception I will run into. Sadly such bug makes this great library practically unusable. |
@RonyDimebag |
@pitops if you succeed please do let me know :) |
@RonyDimebag sure! |
@RonyDimebag I think i found the issue. According to this https://stackoverflow.com/questions/54517101/rrule-not-setting-correct-time-if-dtstart-is-set it seems that doing Instead create a new RRule and add the dtstart there and it should work fine :) - works in my case at least! |
Hey @pitops Wow that's great! You mean put the dstart as part of the actual rrule string? Thanks |
Hey @RonyDimebag, so basically when you make a new rrule using the example new RRule({
...other options
dtstart: <date>
}) If you start with a rrule string then you need to do const rrule = RRule.fromText(<string>)
const rruleWithDTSTART = new RRule({
...rrule.options
dtstart: <date>
})
hope that helps - good luck |
Hi, this should be better documented, but you should consider the |
Hi,
I am generating instances from a string RRule and noticed that the first iteration will not be produced if local time (HH:mm) is earlier than the event's time, regardless of the date and that the instance is in the future.
I am using UTC and all the dates are produced from unix timestamp values.
var dateStart = new Date(1580810460 * 1000); // 1580810460 = Tuesday, 04-Feb-20 10:01:00 UTC
var end = new Date(1583618400 * 1000); // 1583618400 = Saturday, 07-Mar-20 22:00:00 UTC
var nrule = rrule.rrulestr('FREQ=WEEKLY;BYDAY=TU;UNTIL=20200301T000000Z');
nrule.options.dtstart = dateStart;
var set = nrule.between(new Date(dateStart * 1000), new Date(end * 1000), true);
In the example above, if current UTC time is before 10:01, the first supposed instance of this rule that should occur on 04-Feb-20 will not be generated (although it's in the future), while if current UTC time is after 10:01 it will be generated successfully.
I tried this on both 2.2.0 and latest 2.6.0, both yielded same result.
I'm running on latest chrome / windows 10, my local time is GMT+02:00.
Thanks a lot!
The text was updated successfully, but these errors were encountered: