mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-22 13:05:36 +03:00
* (ui): fix date format
This commit is contained in:
parent
a7d2dd7bdb
commit
8856dd6e4c
1 changed files with 1 additions and 5 deletions
|
@ -47,12 +47,8 @@ export const formatTime = (time, options = DEFAULT_TIME_FORMAT) => {
|
|||
* @returns {string} Returns the date and time in the specified format
|
||||
*/
|
||||
export const formatDateTime = (dateTime, options = DEFAULT_DATE_FORMAT_OPTIONS) => {
|
||||
const { language } = navigator;
|
||||
const currentLanguage = (language.slice(0, 2) === 'en' || !language) ? 'en-GB' : language;
|
||||
|
||||
const parsedTime = new Date(dateTime);
|
||||
|
||||
return parsedTime.toLocaleString(currentLanguage, options);
|
||||
return parsedTime.toLocaleString(navigator.language, options);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue