From 94b52ce4d6985bc1b2e8e07c8a318fcb7e0d023c Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Thu, 11 May 2023 17:40:05 +0800 Subject: [PATCH] fix(nc-gui): mysql xcdb logic --- packages/nc-gui/components/cell/DateTimePicker.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/components/cell/DateTimePicker.vue b/packages/nc-gui/components/cell/DateTimePicker.vue index d0da5b5716..0f22c319e8 100644 --- a/packages/nc-gui/components/cell/DateTimePicker.vue +++ b/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 // we convert back to local time if (column.value.title! in (isUpdatedFromCopyNPaste ?? {})) { - localModelValue = dayjs(modelValue + (isXcDB ? 'Z' : '')) + localModelValue = dayjs(modelValue) .utc(isMysql(column.value.base_id)) .local() return localModelValue @@ -84,7 +84,7 @@ let localState = $computed({ // if cdf is defined, that means the value is auto-generated // hence, show the local time 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