fix: |UI| date parse error at mobile devices (#575)

This commit is contained in:
Dream Hunter
2025-01-30 22:42:27 +08:00
committed by GitHub
parent 6ae3b0d85e
commit 7f6a02ca38
10 changed files with 1138 additions and 1122 deletions

View File

@@ -19,6 +19,9 @@ export const utcToLocalDate = (utcDate: string, useUTCDate: boolean) => {
}
try {
const date = new Date(utcDateString);
// if invalid date string
if (isNaN(date.getTime())) return utcDateString;
return date.toLocaleString();
} catch (e) {
console.error(e);