Browse Source

fix/gui-v2-fixed-issue-with-time-picker

pull/2939/head
Muhammed Mustafa 2 years ago
parent
commit
23a961db9a
  1. 11
      packages/nc-gui-v2/components/cell/TimePicker.vue

11
packages/nc-gui-v2/components/cell/TimePicker.vue

@ -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) {

Loading…
Cancel
Save