A javascript library for defining recurring schedules and calculating future (or past) occurrences for them. Includes support for using English phrases and Cron schedules. Works in Node and in the browser.
var gt = later.parse.cron('0/50 1/1 ? ');
var local = new Date("2018-1-29 11:45");
var curDate = new Date();
local.setMinutes(local.getMinutes() - local.getTimezoneOffset());
curDate.setMinutes(curDate.getMinutes() - curDate.getTimezoneOffset());
var arrNextMatchingSchedules = later.schedule(gt).next(5, local, new Date(2099, 12, 31));
console.log(arrNextMatchingSchedules);
I am recieving the results as shown below which is not expected.
Mon Jan 29 2018 17:20:00 GMT+0530 (India Standard Time),
Mon Jan 29 2018 17:30:00 GMT+0530 (India Standard Time),
Mon Jan 29 2018 18:20:00 GMT+0530 (India Standard Time),
Mon Jan 29 2018 18:30:00 GMT+0530 (India Standard Time),
Mon Jan 29 2018 19:20:00 GMT+0530 (India Standard Time
This is one of the scenarios which i am posting here but i have observed couple of scenarios in case of minutes where it is not as per expectation.
I have gone through later.js code and debugged but since there were no comments i am unable to understand what is happening?
later.minutes function is having range variable for 60 and it returns a schedules array by splitiing the cron expression . suppose if i give 50 minutes it will set 50 minutes to one schedule and other 10 minutes which 60-50 as other one and again it resets it.
please help me to extend this logic for the above mentioned scenario.
var gt = later.parse.cron('0/50 1/1 ? '); var local = new Date("2018-1-29 11:45"); var curDate = new Date(); local.setMinutes(local.getMinutes() - local.getTimezoneOffset()); curDate.setMinutes(curDate.getMinutes() - curDate.getTimezoneOffset()); var arrNextMatchingSchedules = later.schedule(gt).next(5, local, new Date(2099, 12, 31)); console.log(arrNextMatchingSchedules);
I am recieving the results as shown below which is not expected.
Mon Jan 29 2018 17:20:00 GMT+0530 (India Standard Time), Mon Jan 29 2018 17:30:00 GMT+0530 (India Standard Time), Mon Jan 29 2018 18:20:00 GMT+0530 (India Standard Time), Mon Jan 29 2018 18:30:00 GMT+0530 (India Standard Time), Mon Jan 29 2018 19:20:00 GMT+0530 (India Standard Time
This is one of the scenarios which i am posting here but i have observed couple of scenarios in case of minutes where it is not as per expectation. I have gone through later.js code and debugged but since there were no comments i am unable to understand what is happening?
later.minutes function is having range variable for 60 and it returns a schedules array by splitiing the cron expression . suppose if i give 50 minutes it will set 50 minutes to one schedule and other 10 minutes which 60-50 as other one and again it resets it.
please help me to extend this logic for the above mentioned scenario.