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

Document Weekday Ordinals #89

Open
manorom opened this issue Jul 14, 2021 · 3 comments
Open

Document Weekday Ordinals #89

manorom opened this issue Jul 14, 2021 · 3 comments

Comments

@manorom
Copy link

manorom commented Jul 14, 2021

Hi,

First of all, thanks for this great crate.

However, the numbering of weekdays seems unusual to me. On the machines I usually work, the crontab uses a 0 for Sunday, 1 for Monday and so on.
This crate seems to use 1 for Sunday and not accept 0.

Maybe this should be documented somewhere.

@sbditto85
Copy link

I would argue that it should be changed to be 0-6 or have a configuration to pick between 0-6 or 1-7 as right now if we wanted to use this crate we'd need to fork it and change it to 0-6. Otherwise, the crate looks great!

@zslayton
Copy link
Owner

zslayton commented Sep 7, 2021

See also: #37. Sunday=1 was taken from the Quartz service.

Maybe this should be documented somewhere.

+1.

I would argue that it should be changed to be 0-6

I can't do this as there are folks using it for parsing Quartz's flavor of cron expressions.

or have a configuration to pick between 0-6 or 1-7

This would be great! There are other settings that would be nice to have, too. Off the top of my head:

  • Named ordinal support for other languages (Mon,Tues,Wed in English -> Lun,Mar,Mer in French)
  • Some locales start the week on Monday, not Sunday.
  • 5-field expressions in which the leftmost field is meant to be a year instead of the rightmost being seconds.

I'd like to have a builder API that lets folks opt into these settings. Exposing a day-of-week ordinals option would be a good place to start. If anyone is interested in implementing that, let me know and we can sketch out what the API should look like.

@hce
Copy link

hce commented Oct 11, 2021

Hello, I'd also like to say this is a great crate! :-)
I'm also here because of the weekday numbering scheme; I was expecting a standard unix scheme where 0 and 7 means sunday, while 1 means monday, etc. It would be great if this behavior could be enabled by some option.

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

No branches or pull requests

4 participants