Conduit.CronParser
Conduit.CronParser — cron expression parser and next-run calculator.
Parses the standard five-field cron syntax:
┌─────── minute (0–59)
│ ┌───── hour (0–23)
│ │ ┌─── day-of-month (1–31)
│ │ │ ┌─ month (1–12)
│ │ │ │ ┌ day-of-week (0–6, 0 = Sunday)
* * * * *Each field may be:
- — any value
N — exact value
N-M — inclusive range
N-M/S — range with step S
*/S — every S values from the field's minimum
a,b,c — comma-separated list of literals or rangesnext_run finds the next DateTime after from that satisfies the expression by stepping minute-by-minute up to one year ahead.
Types
Functions
Return true if dt satisfies all five fields of the parsed expr.
Uses UTC time components (minute, hour, day-of-month, month, day-of-week).Parse a cron expression and return the next run time after from.
The result is the first DateTime at or after `from + 1 minute` that matches
all five fields of the expression. The search is bounded to ~1 year
(527 040 minutes); if no match is found within that window, returns
Err with a descriptive message.
Returns:
Ok(next_run_at) — the next scheduled DateTime (always in the future).
Err(msg) — invalid expression or no match found within 1 year.