Browse Source

fix(nc-gui): mysql xcdb logic

pull/5642/head
Wing-Kam Wong 2 years ago
parent
commit
94b52ce4d6
  1. 4
      packages/nc-gui/components/cell/DateTimePicker.vue

4
packages/nc-gui/components/cell/DateTimePicker.vue

@ -65,7 +65,7 @@ let localState = $computed({
// when pasting a datetime cell, UTC (xcdb) will be saved in DB // when pasting a datetime cell, UTC (xcdb) will be saved in DB
// we convert back to local time // we convert back to local time
if (column.value.title! in (isUpdatedFromCopyNPaste ?? {})) { if (column.value.title! in (isUpdatedFromCopyNPaste ?? {})) {
localModelValue = dayjs(modelValue + (isXcDB ? 'Z' : '')) localModelValue = dayjs(modelValue)
.utc(isMysql(column.value.base_id)) .utc(isMysql(column.value.base_id))
.local() .local()
return localModelValue return localModelValue
@ -84,7 +84,7 @@ let localState = $computed({
// if cdf is defined, that means the value is auto-generated // if cdf is defined, that means the value is auto-generated
// hence, show the local time // hence, show the local time
if (column?.value?.cdf) { if (column?.value?.cdf) {
return dayjs(modelValue).utc(isMysql(column.value.base_id)).local() return dayjs(modelValue).utc().local()
} }
// if localModelValue is defined, show localModelValue instead // if localModelValue is defined, show localModelValue instead

Loading…
Cancel
Save