Skip to content

Commit

Permalink
feat(int-512): add invalid date
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandacanto committed Aug 30, 2022
1 parent 8ebc23d commit d93b237
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/Datepicker/Datepicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
:disabled="disabled"
:placeholder="placeholder"
:value="internalValueFormatted"
:error="invalidDate"
@icon-click="handleInputClick"
@clear="handleClear"
@keyup.enter="handleDoneAction"
Expand Down Expand Up @@ -195,6 +196,7 @@ export default {
datetime: '####-##-## ##:##',
},
hitClear: false,
invalidDate: false,
}),
computed: {
Expand Down Expand Up @@ -286,6 +288,7 @@ export default {
dayjs(this.internalValue, this.internalFormat, true).isValid()
) {
this.internalDate = this.internalValue
this.invalidDate = false
}
},
},
Expand Down Expand Up @@ -319,7 +322,7 @@ export default {
true
).isValid()
if (!isValid || (this.hasDayDisabled && this.isDateDisabled())) {
this.handleClear(this.internalValue)
this.invalidDate = true
return
}
Expand Down

0 comments on commit d93b237

Please sign in to comment.