Skip to content

Commit

Permalink
fix: fix customParseFormat plugin parsing date bug (#1198)
Browse files Browse the repository at this point in the history
fix #1194
  • Loading branch information
andrewhood125ruhuc committed Jul 12, 2028
1 parent 4dd5db3 commit b76776a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugin/customParseFormat/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function correctHours(time) {
}

function makeParser(format) {
format = u(format, locale.formats)
format = u(format, locale && locale.formats)
const array = format.match(formattingTokens)
const { length } = array
for (let i = 0; i < length; i += 1) {
Expand Down Expand Up @@ -224,6 +224,8 @@ export default (o, C, d) => {
if (isStrict && date !== this.format(format)) {
this.$d = new Date('')
}
// reset global locale to make parallel unit test
locale = undefined
} else if (format instanceof Array) {
const len = format.length
for (let i = 1; i <= len; i += 1) {
Expand Down

0 comments on commit b76776a

Please sign in to comment.