Skip to content

fix: use navigator.locale to evaluate time format #17025

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

Merged
merged 1 commit into from
Mar 20, 2025
Merged

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Mar 20, 2025

Fixes: #15452

It's second attempt.

This time we use navigator.locale to check the browser/OS locale.

@mtojek mtojek self-assigned this Mar 20, 2025
@mtojek mtojek requested a review from mafredri March 20, 2025 14:14
@mtojek mtojek marked this pull request as ready for review March 20, 2025 14:14
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍🏻

@@ -79,6 +79,7 @@ export const ScheduleForm: FC<ScheduleFormProps> = ({
},
});
const getFieldHelpers = getFormHelpers<ScheduleFormValues>(form, submitError);
const browserLocale = navigator.language || "en-US";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disappointed we have to use language as an approximation 😔. I prefer to use English US for text and UI language but Finland is used for numbers, time and currency. Yet this is not available to the browser (AFAICT).

@mtojek mtojek merged commit 287e319 into main Mar 20, 2025
32 of 34 checks passed
@mtojek mtojek deleted the 15452-12-24-2 branch March 20, 2025 14:53
@github-actions github-actions bot locked and limited conversation to collaborators Mar 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for changing from 12 to 24-hour time
2 participants