|
|
@ -22,13 +22,20 @@ const localState = $computed({ |
|
|
|
if (!modelValue) { |
|
|
|
if (!modelValue) { |
|
|
|
return undefined |
|
|
|
return undefined |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
let dateTime = dayjs(modelValue) |
|
|
|
|
|
|
|
|
|
|
|
if (!dayjs(modelValue).isValid()) { |
|
|
|
if (!dateTime.isValid()) { |
|
|
|
|
|
|
|
dateTime = dayjs(modelValue, 'HH:mm:ss') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!dateTime.isValid()) { |
|
|
|
|
|
|
|
dateTime = dayjs(`1999-01-01 ${modelValue}`) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!dateTime.isValid()) { |
|
|
|
isTimeInvalid = true |
|
|
|
isTimeInvalid = true |
|
|
|
return undefined |
|
|
|
return undefined |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return dayjs(modelValue) |
|
|
|
return dateTime |
|
|
|
}, |
|
|
|
}, |
|
|
|
set(val?: dayjs.Dayjs) { |
|
|
|
set(val?: dayjs.Dayjs) { |
|
|
|
if (!val) { |
|
|
|
if (!val) { |
|
|
|