- Fix bug where
.nextDate
was returning incorrect dates, causing tasks to run continuously without delays, when running on Node.js v14.0.0 or greater. Bug was caused by theIntl.DateTimeFormat
API returning '24:00:00' instead of '00:00:00' on Node.js > v14.0.0.
- Added
refreshSchedulerTimer()
function, to update the next execution time of all tasks and refresh the scheduler timer. Should be called when the system time is changed to ensure tasks are run at the correct times
- Fix bug when
task.start()
is called on a running task
CronosExpression
now haswarnings
property that lists possible errors in the expression. Currently supports detecting cases where increment value is larger than the valid (or supplied) range for a fieldscheduleTask
,CronosExpression.parse()
andvalidate
now support strict option, which when enabled will throw an error if warnings were generated during parsing
- Support for the
?
symbol as a alias to*
in the Day of Month and Day of Week fields
- Larger year range (now 0-275759, previously 1970-2099) allowed in year field
- Improved documentation on cron expression syntax
- Support for providing a date, array of dates, or a custom date sequence to
new CronosTask()
instead of aCronosExpression
object
- Support wrap-around ranges for cyclic type fields (ie. Second, Minute, Hour, Month and Day of Week)
- Fix bug causing task to continue to run if
task.stop()
is called in therun
callback
- Fix bug where when multiple tasks are scheduled, they are inserted into the task queue in the wrong order, causing the jobs to not fire at the correct times
- Original cron string passed to
CronosExpression.parse()
accessable onCronosExpression.cronString
property .toString()
returns more useful information onCronosExpression
andCronosTimezone
- Added workaround for bug when
Array.prototype.find
is incorrectly polyfilled - Added check to ensure tasks only run at most once a second
- Switched to @pika/pack for building, adding builds optimised for node, browsers and modern ES module support (eg. Webpack, modern browsers)
- Improved test coverage
First release of CronosJS, featuring:
- Extended cron syntax support, including last day (
L
), nearest weekday (W
), nth of month (#
), optional second and year fields, and predefined expressions - Fixed offset and IANA timezone support, via
Intl
api - Configurable daylight saving handling
- Zero dependencies