This commit is contained in:
dap
2026-04-28 09:49:13 +08:00
4 changed files with 26 additions and 4 deletions

View File

@@ -20,6 +20,9 @@ type Format =
| (string & {});
export function formatDate(time?: FormatDate, format: Format = 'YYYY-MM-DD') {
if (time === undefined || time === null || time === '') {
return '';
}
try {
const date = dayjs.isDayjs(time) ? time : dayjs(time);
if (!date.isValid()) {