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

Dates: use default locale to display dates #6

Merged
merged 1 commit into from
Jul 22, 2024
Merged

Conversation

XeR
Copy link
Contributor

@XeR XeR commented Jul 21, 2024

Shovel uses Intl.DateTimeFormat to format times. This commmit removes the hardcoded en-US locale to use the locale defined by the user.

This fixes dates using 12-hours time (AM/PM) instead of 24-hours time on user agents that are configured to use 24-hours times.

It also affects the dates format (MM/DD/YYYY).

Before:

From 7/20/2024, 11:17:59.638 PM to 7/20/2024, 11:17:59.936 PM, tick 557

After (locale en-GB):

From 20/07/2024, 23:17:59.638 to 20/07/2024, 23:17:59.936, tick 557

Shovel uses `Intl.DateTimeFormat` to format times.
This commmit removes the hardcoded `en-US` locale to use the locale defined by
the user.

This fixes dates using 12-hours time (AM/PM) instead of 24-hours time on user
agents that are configured to use 24-hours times.

It also affects the dates format (MM/DD/YYYY).

Before:
```
From 7/20/2024, 11:17:59.638 PM to 7/20/2024, 11:17:59.936 PM, tick 557
```

After (locale `en-GB`):
```
From 20/07/2024, 23:17:59.638 to 20/07/2024, 23:17:59.936, tick 557
```
@aiooss-anssi aiooss-anssi merged commit 3df3d20 into ANSSI-FR:dev Jul 22, 2024
2 checks passed
@aiooss-anssi
Copy link
Contributor

Thanks!

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 this pull request may close these issues.

2 participants