Time & date4 exports
Raw Markdown/cron
Standard 5-field cron expression parsing, validation, and schedule matching (Cron, is-matching?, is-matching-now?).
Functions & symbols#
Cron#
constructor
Parses and validates a 5-field cron schedule expression.
| Parameter | Type | Optional | Description |
|---|---|---|---|
pattern | String | required | 5-field cron expression (e.g. "*/5 * * * 1-5") |
Returns:
Any(let sched (cron/Cron "0 9 * * 1-5"))is-matching-now?#
function
Returns `true` if the current UTC minute matches `pattern`.
| Parameter | Type | Optional | Description |
|---|---|---|---|
pattern | Cron | String | required | Cron schedule or string |
Returns:
Any(cron/is-matching-now? "* * * * *")is-matching?#
function
Returns `true` if `temporal` matches the cron schedule.
| Parameter | Type | Optional | Description |
|---|---|---|---|
pattern | Cron | String | required | Cron schedule or string |
temporal | Date | Time | Date-Time | Zoned-Date-Time | Instant | required | Timestamp or civil datetime to test |
Returns:
Any(cron/is-matching? "0 9 * * *" dt)is-valid?#
function
Returns `true` if `pattern` is a valid 5-field cron expression.
| Parameter | Type | Optional | Description |
|---|---|---|---|
pattern | String | required | Cron expression string |
Returns:
Any(cron/is-valid? "0 * * * *") ; -> true