Skip to content

Commit

Permalink
docs: Added .now() documentation. Removed .restart().
Browse files Browse the repository at this point in the history
  • Loading branch information
shannonmoeller committed Oct 13, 2016
1 parent 79c3a90 commit a4978fa
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Expand Up @@ -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?
Expand Down

0 comments on commit a4978fa

Please sign in to comment.