Skip to content

Commit 1ad2e22

Browse files
authored
docs(readme): update nextDates documentation (#702)
1 parent 141aa00 commit 1ad2e22

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ For day-of-week indexing, we only added support for `7` as Sunday, so you don't
4444

4545
- **constructor no longer accepts an object as its first and only params. Use `CronJob.from(argsObject)` instead.**
4646
- **callbacks are now called in the order they were registered.**
47+
- **`nextDates(count?: number)` now always returns an array (empty if no argument is provided). Use `nextDate()` instead for a single date.**
4748

4849
### Removed methods
4950

@@ -131,7 +132,8 @@ Parameter Based
131132
- `setTime` - Stops and changes the time for the `CronJob`. Param must be a `CronTime`.
132133
- `lastDate` - Tells you the last execution date.
133134
- `nextDate` - Provides the next date that will trigger an `onTick`.
134-
- `nextDates` - Provides an array of the next set of dates that will trigger an `onTick`.
135+
- `nextDates(count)` - Provides an array of the next set of dates that will trigger an `onTick`.
136+
- `count` - [OPTIONAL] - The number of next dates to return. Defaults to 0, returning an empty array.
135137
- `fireOnTick` - Allows you to override the `onTick` calling behavior. This matters so only do this if you have a really good reason to do so.
136138
- `addCallback` - Allows you to add `onTick` callbacks. Callbacks are run in the order they are registered.
137139
- `CronTime`

0 commit comments

Comments
 (0)