Open alesmenzelsocialbakers opened 7 years ago
The start time is considered valid if it meets all of the constraints specified. Since you've only specified that every minute is valid, the current time meets that constraint and is returned. To get your expected result you can either add another constraint for 0 seconds or modify the start time to be on the next minute.
That does not help. Trying every 0 seconds every 1 minute
which results in running 60 times per minute - not what i wanted.
I want to specify interval to run every minute from the closest minute (i.e. first comment).
BTW: If I set the interval to 59s, it returns this:
See the +1s and +59s differences, that cant be right.
[ 2017-02-15T18:45:59.078Z,
2017-02-15T18:46:00.078Z,
2017-02-15T18:46:59.078Z,
2017-02-15T18:47:00.078Z,
2017-02-15T18:47:59.078Z ]
Secondly:
Interval 'every 60 s'
returns error code 6.
Repro steps:
const later = require('later');
const interval = later.parse.text('every 60 s');
const res = later.schedule(interval).next(5);
console.log(res);
Try using this workaround.
later.schedule(...).next(...) gives incorrect next date
Reproduce steps:
Current datetime =
Wed Feb 15 2017 11:18:16 GMT+0100 (Central Europe Standard Time)
Result:Wed Feb 15 2017 11:18:16 GMT+0100 (Central Europe Standard Time)
Expected result:Wed Feb 15 2017 11:19:00 GMT+0100 (Central Europe Standard Time)