From dfb3434243a5e10593680faa1e63a5919172871f Mon Sep 17 00:00:00 2001 From: zhangjintao Date: Mon, 25 Mar 2024 16:14:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E8=A1=8C12=E5=B0=8F=E6=97=B6=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=EF=BC=8C=E5=87=BA=E7=8E=B0jscrash=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangjintao --- common/src/main/ets/default/utils/DateUtil.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/src/main/ets/default/utils/DateUtil.ts b/common/src/main/ets/default/utils/DateUtil.ts index 5b87ec07..2f60ac2e 100644 --- a/common/src/main/ets/default/utils/DateUtil.ts +++ b/common/src/main/ets/default/utils/DateUtil.ts @@ -31,6 +31,9 @@ export class DateUtil { // Get the date after localization (year-month-day) public static getLocalizedDate(milliseconds: number): string { + if(milliseconds === undefined){ + milliseconds = new Date().getTime() + } let locales: string = this.getLocales(); return new Intl.DateTimeFormat(locales, { year: 'numeric',