diff --git a/packages/synapse-bridge/src/patterns/DatePicker/DatePicker.vue b/packages/synapse-bridge/src/patterns/DatePicker/DatePicker.vue index 62f1e32a8..f2fb3cab3 100644 --- a/packages/synapse-bridge/src/patterns/DatePicker/DatePicker.vue +++ b/packages/synapse-bridge/src/patterns/DatePicker/DatePicker.vue @@ -102,8 +102,8 @@ export default defineComponent({ startDateFormatted() { return this.startDate ? dayjs(this.startDate, 'YYYY-MM-DD').format( - this.dateFormatReturn - ) + this.dateFormatReturn + ) : null }, inputRules() { @@ -123,6 +123,9 @@ export default defineComponent({ } return null }, + computedTextFieldValue() { + return dayjs(this.textFieldValue, this.dateFormat, true) + }, }, watch: { modelValue: { @@ -221,7 +224,7 @@ export default defineComponent({ async updateMessages() { const textField = this.$refs[ 'text-field' - ] as ComponentPublicInstance + ] as ComponentPublicInstance if (!textField) return this.validateWarning(this.internalValue) @@ -291,7 +294,7 @@ export default defineComponent({ @update:focused=" (e: boolean) => { handleFocusChange(e) - e ? onFocus() : onBlur() + e ? onFocus() : computedTextFieldValue.isValid() ? onBlur() : null } " @click:clear="onClear"