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

Datetimepicker do not follow 'First day of the week' Calendar Customization #231

Closed
r-xyz opened this issue May 23, 2024 · 1 comment · Fixed by #234
Closed

Datetimepicker do not follow 'First day of the week' Calendar Customization #231

r-xyz opened this issue May 23, 2024 · 1 comment · Fixed by #234

Comments

@r-xyz
Copy link
Contributor

r-xyz commented May 23, 2024

NEMO has built-in functionality to select first day of week.

This apply correctly to weekly/monthly Calendar views:

Unfortunately, the same setting is not consistently implemented in datetimepicker.

Current datetimepicker do not implement any weekStart option, but if you have any suggestions on how to implement it, I can submit a PR.

@rptmat57
Copy link
Contributor

there is a way, or at least something to start thinking about:

moment.updateLocale('en', {
  week: { dow: 1 } // Monday is the first day of the week
});

now, it has to be done before creating the pickers, so ideally it would be placed in the base.html template, at the top right after loading moment.js.

Or even better, at the top of nemo.js. that might be easier and faster.

Now, I don't believe moment.js automatically sets the locale, so this should work for everyone regardless of their browser/computer's locale.

r-xyz added a commit to r-xyz/NEMO that referenced this issue Jun 2, 2024
r-xyz added a commit to r-xyz/NEMO that referenced this issue Jun 2, 2024
Closes usnistgov#231 .
Added customization to base.html.
rptmat57 pushed a commit that referenced this issue Jun 3, 2024
* Datetime picker: First day of the week.
Closes #231.

* Revert "Datetime picker: First day of the week."

This reverts commit f29bafb.

* Datetime picker: First day of the week.
Closes #231 .
Added customization to base.html.

* Datetime picker: remove unnecessary db query.
@rptmat57 rptmat57 closed this as completed Jun 4, 2024
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

Successfully merging a pull request may close this issue.

2 participants