feat(common): Compatible with yy/MM/dd HH: mm: ss time format (#1121)

This commit is contained in:
chenxi-20 2023-12-14 15:45:12 +08:00 committed by GitHub
parent 594c7fa8f0
commit a182bb2034
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -33,6 +33,7 @@ const dateFormatRegs = {
'M{1,2}': /M{1,2}/,
'd{1,2}': /d{1,2}/,
'h{1,2}': /h{1,2}/,
'H{1,2}': /H{1,2}/,
'm{1,2}': /m{1,2}/,
's{1,2}': /s{1,2}/,
'S{1,3}': /S{1,3}/,
@ -406,6 +407,7 @@ export const format = function (date, dateFormat = 'yyyy/MM/dd hh:mm:ss') {
'M{1,2}': date.getMonth() + 1,
'd{1,2}': date.getDate(),
'h{1,2}': date.getHours(),
'H{1,2}': date.getHours(),
'm{1,2}': date.getMinutes(),
's{1,2}': date.getSeconds(),
'S{1,3}': date.getMilliseconds(),