Skip to content

Commit 103b3e3

Browse files
authored
Merge pull request #18535 from linghaoSu/fix/time-format
fix(time-format): fix yy time format
2 parents 6b4f895 + e39e3df commit 103b3e3

2 files changed

Lines changed: 132 additions & 1 deletion

File tree

src/util/time.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ export function format(
133133

134134
return (template || '')
135135
.replace(/{yyyy}/g, y + '')
136-
.replace(/{yy}/g, y % 100 + '')
136+
.replace(/{yy}/g, pad(y % 100 + '', 2))
137137
.replace(/{Q}/g, q + '')
138138
.replace(/{MMMM}/g, month[M - 1])
139139
.replace(/{MMM}/g, monthAbbr[M - 1])

test/ut/spec/util/time.test.ts

Lines changed: 131 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)