-
Notifications
You must be signed in to change notification settings - Fork 12k
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
GrafanaData: Fix week start for non-English browsers #50582
GrafanaData: Fix week start for non-English browsers #50582
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
(I am not sure that getWeekdayIndex()
is still used anywhere else?)
It's not used in Grafana codebase but as it's part of |
You are absolutely right @AgnesToulet, sorry, I somehow missed that. 👍 |
* grafana-data: Fix start week for non-English browsers * apply review suggestion (cherry picked from commit 99c8ce5)
What this PR does / why we need it:
This PR fixes the week start behavior on browsers using another language than English. The issue was that
weekdays()
return the week days in the set locale and we compare it with values from the backend that are always in English (at least for now); so we couldn't find the week day index and setting the week start in the preferences or the dashboard settings didn't work.Special notes for your reviewer:
I didn't find a better way to ensure that the
getWeekdayIndex
function doesn't change the locale but I'm not very familiar withmoment
. I couldn't find anything else in the doc though.