Localize only the moment instance

This commit is contained in:
Cohee
2024-10-28 11:01:48 +02:00
parent ebd6377d5d
commit 9493d05f2c
2 changed files with 4 additions and 3 deletions

View File

@ -14,6 +14,7 @@ import { Popup, POPUP_RESULT, POPUP_TYPE } from './popup.js';
import { SlashCommandClosure } from './slash-commands/SlashCommandClosure.js';
import { getTagsList } from './tags.js';
import { groups, selected_group } from './group-chats.js';
import { getCurrentLocale } from './i18n.js';
/**
* Pagination status string template.
@ -838,7 +839,7 @@ export function timestampToMoment(timestamp) {
}
const iso8601 = parseTimestamp(timestamp);
const objMoment = iso8601 ? moment(iso8601) : moment.invalid();
const objMoment = iso8601 ? moment(iso8601).locale(getCurrentLocale()) : moment.invalid();
dateCache.set(timestamp, objMoment);
return objMoment;