cron
cron copied to clipboard
Make 'seconds' field optional
The year
field is currently optional, with expressions being comprised of six or seven fields accordingly. I would like to also accept expressions which have neither seconds
nor years
, for a total of five fields. Importantly, expressions that do not include seconds
but which do include years
would be illegal.
@zslayton
May be use proxy object 'ScheduleBuilder'
let s = Schedule::builder() // ScheduleBuilder::default()
.with_seconds(true)
.with_years(true)
.parse(...)
Importantly, expressions that do not include seconds but which do include years would be illegal.
To clarify this, the parser would treat any expression with 6 fields as having years
. It would be impossible to detect the user's intent in some cases (e.g. * * * * * *
), so this would simply be noted in the documentation.
May be use proxy object 'ScheduleBuilder'
I'm open to this approach. There are other settings that it would be nice to support -- e.g. whether day_of_week
should be 0-indexed or 1-indexed, which varies between implementations. (This is relevant to #37.)