mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix(frontend): date normalization
This commit is contained in:
@@ -14,3 +14,9 @@ export const getDateTimeFormatter = (date: Date) => ({
|
||||
val: DATE_TIME_FORMAT,
|
||||
},
|
||||
});
|
||||
|
||||
export const normalizeDate = (locale: string, dateField?: Date | string) =>
|
||||
(typeof dateField === "string"
|
||||
? new Date(dateField)
|
||||
: dateField
|
||||
)?.toLocaleString(locale);
|
||||
|
||||
Reference in New Issue
Block a user