Skip to content

Commit 67a9a1e

Browse files
committed
refactor(dateinput): Simplify formatTypedDate method
1 parent 8bb9c99 commit 67a9a1e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/DateInput.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ export default {
182182
formatTypedDate() {
183183
const parsedDate = this.parseInput()
184184
185-
if (Number.isNaN(parsedDate)) {
185+
if (this.utils.isValidDate(parsedDate)) {
186+
this.typedDate = this.formatDate(parsedDate)
187+
} else {
186188
this.input.value = ''
187189
this.typedDate = ''
188-
} else {
189-
this.typedDate = this.formatDate(parsedDate)
190190
}
191191
},
192192
/**

0 commit comments

Comments
 (0)