From 03211d8a9306fcb79067e34abee8e2aa6881f30b Mon Sep 17 00:00:00 2001 From: dgflash Date: Thu, 16 Oct 2025 11:25:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DDateExt=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E8=BD=AC=E5=8C=96=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/libs/extension/DateExt.ts | 2 +- assets/libs/model-view/StringFormat.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/libs/extension/DateExt.ts b/assets/libs/extension/DateExt.ts index 36a44a5..f4c437d 100644 --- a/assets/libs/extension/DateExt.ts +++ b/assets/libs/extension/DateExt.ts @@ -32,7 +32,7 @@ Date.prototype.format = function (format: string): string { let r = format .replace('yy', year.toString()) - .replace('mm', (month < 10 ? '0' : '') + month) + .replace('MM', (month < 10 ? '0' : '') + month) .replace('dd', (day < 10 ? '0' : '') + day) .replace('hh', (hours < 10 ? '0' : '') + hours) .replace('mm', (minutes < 10 ? '0' : '') + minutes) diff --git a/assets/libs/model-view/StringFormat.ts b/assets/libs/model-view/StringFormat.ts index 5091214..5b24aae 100644 --- a/assets/libs/model-view/StringFormat.ts +++ b/assets/libs/model-view/StringFormat.ts @@ -9,7 +9,7 @@ class StringFormat { if (format === '') return value as string; format = format.toLowerCase().trim(); // 不区分大小 - let match_func = format.match(/^[a-z|A-Z]+/gi); // 匹配到 format 中的 函数名 + let match_func = format.match(/^[a-z|A-Z]+/gi); // 匹配到 format 中的函数名 let match_num = format.match(/\d+$/gi); // 匹配到 format 中的参数 let func: string = ''; let num: number = 0;