mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 09:41:40 -05:00
Set en-GB as the fallback locale
This commit is contained in:
parent
bf8dc7f872
commit
b9d3ac9bb0
1 changed files with 8 additions and 1 deletions
|
|
@ -55,7 +55,14 @@ export function minutesToDaysHoursMinutes(minutes) {
|
|||
|
||||
export function formatDate(timestamp, timezone) {
|
||||
const date = new Date(timestamp * 1000);
|
||||
const locale = navigator.languages !== undefined ? navigator.languages[0] : navigator.language;
|
||||
let locale;
|
||||
if (navigator.languages !== undefined) {
|
||||
locale = navigator.languages[0];
|
||||
} else if (navigator.language) {
|
||||
locale = navigator.language;
|
||||
} else {
|
||||
locale = 'en-GB';
|
||||
}
|
||||
return date.toLocaleString(locale, { timeZone: timezone });
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue