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;