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

[enchantment] Select first day of week #18

Open
o-murphy opened this issue Nov 29, 2023 · 4 comments
Open

[enchantment] Select first day of week #18

o-murphy opened this issue Nov 29, 2023 · 4 comments

Comments

@o-murphy
Copy link
Contributor

In some locales the first day of a week is a Saturday, we can to add support of this feature

@noXplode
Copy link
Owner

noXplode commented Dec 15, 2023

As far as I can tell, locale or calendar modules does not have a feature of automatically setting first day of week in calendar from locale value, we can just set it manually through calendar.setfirstweekday(6) for example. Do you think theres a point of adding parameter of setting first day of week?

@o-murphy
Copy link
Contributor Author

As far as I can tell, locale or calendar modules does not have a feature of automatically setting first day of week in calendar from locale value, we can just set it manually through calendar.setfirstweekday(6) for example. Do you think theres a point of adding parameter of setting first day of week?

Yes you're right, locale or calendar don't have this feature. In common people uses 2 different variants is Monday or Sunday, so we need no implement all of them. Monday is compatible with ISO8601 standard, but Sunday uses in a Greco-Roman style (in USA, Japan etc) We can add such an optional flag kinda is_sunday_first to the init method, to not create a separate method for this feature

@o-murphy
Copy link
Contributor Author

Now I think about the refactoring of month keyboard generator, cause it can be simpler I think so. And we need to check if python's calendar is accept Sunday as first weekday. This feature is not as important, so we don't need to take it from User props.

@o-murphy
Copy link
Contributor Author

o-murphy commented Dec 15, 2023

So, we can use calendar.setfirstweekday if the init accept an additional argument, what's have to be 0 by default

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

2 participants