From a4978fae6c387abfb4e92a0f07741fa13e27fc4d Mon Sep 17 00:00:00 2001 From: Shannon Moeller Date: Thu, 13 Oct 2016 10:05:53 -0400 Subject: [PATCH] docs: Added .now() documentation. Removed .restart(). --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ffdfc63..afddc49 100644 --- a/README.md +++ b/README.md @@ -88,12 +88,17 @@ const removeTask = cron.addTask('* * * * * *', () => { removeTask(); ``` -### cron.restart() +### cron.now(fn) -Stops the clock, resets each tasks' internal schedule, then restarts the clock. +- `fn` `Function` + +Sets the [`moment.now`](http://momentjs.com/docs/#/customization/now/) function and resets internal cron timers. ```js -cron.restart(); +cron.now(() => { + // It's tomorrow! Heh heh. + return Number(new Date()) + (24 * 60 * 60 * 1000); +}); ``` ## Why?