mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-07 19:07:30 +08:00
修复DateExt时间格式化转化错误问题
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user