diff --git a/src/lib/utils/time-utils.ts b/src/lib/utils/time-utils.ts index 64bbb893..05ca793b 100644 --- a/src/lib/utils/time-utils.ts +++ b/src/lib/utils/time-utils.ts @@ -1,8 +1,10 @@ +import i18next from 'i18next'; + export const getFormattedDate = (commentTimestamp: number) => { if (commentTimestamp === undefined || isNaN(commentTimestamp)) { return ''; } - const locale = Intl.DateTimeFormat().resolvedOptions().locale; + const locale = i18next.language || 'en'; const string = new Intl.DateTimeFormat(locale, { hour12: false, year: '2-digit',