fix: invalid date handling (#7422)

fix AF-1049
This commit is contained in:
pengx17
2024-07-04 07:11:18 +00:00
parent d6ad7d566f
commit 5c1f78afd4
2 changed files with 9 additions and 0 deletions
+4
View File
@@ -73,6 +73,10 @@ export function i18nTime(
) {
const i18n = options.i18n ?? I18n;
time = dayjs(time);
if (!time.isValid()) {
return ''; // invalid time, return empty string
}
const now = dayjs(options.now);
const defaultRelativeOption = {