Last active
January 29, 2016 15:05
-
-
Save leonardonsantos/e4356f688c701891d167 to your computer and use it in GitHub Desktop.
npm later bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var later = require('later'); | |
var timeString = "0 * * * *"; | |
function nextSchedule(cronTimeString, cont){ | |
var schedule = later.parse.cron(cronTimeString, true); | |
later.date.localTime() | |
var results = later.schedule(schedule).next(cont); | |
return(results); | |
} | |
console.log(nextSchedule(timeString, 3)); | |
/* | |
OUTPUT: | |
[ Fri Jan 29 2016 11:02:00 GMT-0400 (AMT), | |
Fri Jan 29 2016 11:03:00 GMT-0400 (AMT), | |
Fri Jan 29 2016 11:04:00 GMT-0400 (AMT) ] | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment