Open nmacherey opened 4 years ago
Potentially similar to or same as #373, I think. I'm running into what appears to be the same thing. Here's my example:
rrule version: 2.6.4 os: macOS Mojave 10.14.6 local timezone: MDT
Code sample
const { RRule } = require('rrule');
const rule = new RRule({
freq: RRule.MINUTELY,
interval: 30,
byweekday: [RRule.MO],
dtstart: new Date(Date.UTC(2020, 7, 3)),
until: new Date(Date.UTC(2020, 7, 20)),
byhour: [14, 15, 16, 17]
});
rule.all(date => {
console.log(date.toUTCString());
return true;
});
Expected output
Mon, 03 Aug 2020 14:00:00 GMT
Mon, 03 Aug 2020 14:30:00 GMT
Mon, 03 Aug 2020 15:00:00 GMT
Mon, 03 Aug 2020 15:30:00 GMT
Mon, 03 Aug 2020 16:00:00 GMT
Mon, 03 Aug 2020 16:30:00 GMT
Mon, 03 Aug 2020 17:00:00 GMT
Mon, 03 Aug 2020 17:30:00 GMT
Mon, 10 Aug 2020 14:00:00 GMT
Mon, 10 Aug 2020 14:30:00 GMT
Mon, 10 Aug 2020 15:00:00 GMT
Mon, 10 Aug 2020 15:30:00 GMT
Mon, 10 Aug 2020 16:00:00 GMT
Mon, 10 Aug 2020 16:30:00 GMT
Mon, 10 Aug 2020 17:00:00 GMT
Mon, 10 Aug 2020 17:30:00 GMT
Mon, 17 Aug 2020 14:00:00 GMT
Mon, 17 Aug 2020 14:30:00 GMT
Mon, 17 Aug 2020 15:00:00 GMT
Mon, 17 Aug 2020 15:30:00 GMT
Mon, 17 Aug 2020 16:00:00 GMT
Mon, 17 Aug 2020 16:30:00 GMT
Mon, 17 Aug 2020 17:00:00 GMT
Mon, 17 Aug 2020 17:30:00 GMT
Actual output
Mon, 03 Aug 2020 14:00:00 GMT
Mon, 03 Aug 2020 14:30:00 GMT
Mon, 03 Aug 2020 15:00:00 GMT
Mon, 03 Aug 2020 15:30:00 GMT
Mon, 03 Aug 2020 16:00:00 GMT
Mon, 03 Aug 2020 16:30:00 GMT
Mon, 03 Aug 2020 17:00:00 GMT
Mon, 03 Aug 2020 17:30:00 GMT
Mon, 10 Aug 2020 16:00:00 GMT
Mon, 10 Aug 2020 16:30:00 GMT
Mon, 10 Aug 2020 17:00:00 GMT
Mon, 10 Aug 2020 17:30:00 GMT
Mon, 17 Aug 2020 16:00:00 GMT
Mon, 17 Aug 2020 16:30:00 GMT
Mon, 17 Aug 2020 17:00:00 GMT
Mon, 17 Aug 2020 17:30:00 GMT
Locally I added the following test. Looks like some occurrences are skipped based on the third occurrence in the test output (those that should be on the 9th and 16th, I think). Seems similar to what happens in the examples.
testRecurring('testMinutelyByWeekDayAndHour',
new RRule({freq: RRule.MINUTELY,
byweekday: RRule.TU,
byhour: 9,
interval: 30,
dtstart: parse('19970902T090000'),
count: 3
}),
[
datetime(1997, 9, 2, 9, 0),
datetime(1997, 9, 2, 9, 30),
datetime(1997, 9, 9, 9, 0)
]
)
374 passing (2s)
9 pending
1 failing
1) RRule
testMinutelyByWeekDayAndHour [every 30 minutes for 3 times] [DTSTART:19970902T090000Z
RRULE:FREQ=MINUTELY;BYDAY=TU;BYHOUR=9;INTERVAL=30;COUNT=3]:
- 3/3
+ expected - actual
-Tue Sep 09 1997 03:00:00 GMT-0600 (Mountain Daylight Time)
+Tue Sep 23 1997 03:00:00 GMT-0600 (Mountain Daylight Time)
Sorry for up, but did you found a solution? thx
Did you found any solution to this?
Hi,
I am playing with the demo and I do not see expected results when using multiple values in byweekday in combination with freq = MINUTELY and interval = 20 for example.
Shows proper results (every 20 minutes between 9:00 and 17:00)
But using
Show proper values for Monday and only values between 15:00 and 17:00 for Fridays