Skip to content

Commit fac2f99

Browse files
SonTT19johnleider
andauthored
fix(VDateInput): transform model in / out for VConfirmEdit (#20281)
fixes #20146 Co-authored-by: John Leider <[email protected]>
1 parent 1461d7e commit fac2f99

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/vuetify/src/labs/VDateInput/VDateInput.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,14 @@ export const VDateInput = genericComponent<VDateInputSlots>()({
6262
const { t } = useLocale()
6363
const adapter = useDate()
6464
const { isFocused, focus, blur } = useFocus(props)
65-
const model = useProxiedModel(props, 'modelValue', props.multiple ? [] : null)
65+
const model = useProxiedModel(
66+
props,
67+
'modelValue',
68+
props.multiple ? [] : null,
69+
val => Array.isArray(val) ? val.map(item => adapter.toJsDate(item)) : val ? adapter.toJsDate(val) : val,
70+
val => Array.isArray(val) ? val.map(item => adapter.date(item)) : val ? adapter.date(val) : val
71+
)
72+
6673
const menu = shallowRef(false)
6774
const vDateInputRef = ref()
6875

@@ -100,7 +107,7 @@ export const VDateInput = genericComponent<VDateInputSlots>()({
100107

101108
const target = e.target as HTMLInputElement
102109

103-
model.value = adapter.date(target.value)
110+
model.value = target.value
104111
}
105112

106113
function onClick (e: MouseEvent) {

0 commit comments

Comments
 (0)