refac/enh: date format i18n

This commit is contained in:
Timothy Jaeryang Baek
2025-09-12 23:53:23 +04:00
parent 3f137f9bbc
commit 2227f24bd6
61 changed files with 202 additions and 8 deletions
+3 -4
View File
@@ -378,14 +378,13 @@ export const generateInitialsImage = (name) => {
export const formatDate = (inputDate) => {
const date = dayjs(inputDate);
const now = dayjs();
if (date.isToday()) {
return `Today at ${date.format('LT')}`;
return `Today at {{LOCALIZED_TIME}}`;
} else if (date.isYesterday()) {
return `Yesterday at ${date.format('LT')}`;
return `Yesterday at {{LOCALIZED_TIME}}`;
} else {
return `${date.format('L')} at ${date.format('LT')}`;
return `{{LOCALIZED_DATE}} at {{LOCALIZED_TIME}}`;
}
};