Browse Source

Merge pull request #2939 from nocodb/fix/gui-v2-fixed-issue-with-time-picker

fix/gui-v2-fixed-issue-with-time-picker
pull/2948/head
Muhammed Mustafa 2 years ago committed by GitHub
parent
commit
225090cf82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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