Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make 'seconds' field optional #13

Open
zslayton opened this issue Feb 14, 2017 · 2 comments
Open

Make 'seconds' field optional #13

zslayton opened this issue Feb 14, 2017 · 2 comments
Assignees

Comments

@zslayton
Copy link
Owner

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.

@anton-dutov
Copy link

anton-dutov commented Oct 5, 2019

@zslayton

May be use proxy object 'ScheduleBuilder'

let s = Schedule::builder() // ScheduleBuilder::default()
    .with_seconds(true)
    .with_years(true)
    .parse(...)

@zslayton
Copy link
Owner Author

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants