From 873ed4be5acbd29088cbdfdbb42c99a95133f247 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Wed, 10 May 2023 20:41:16 +0800 Subject: [PATCH] fi(nc-gui): convert ext db mysql back to utc --- .../nc-gui/composables/useMultiSelect/convertCellData.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/composables/useMultiSelect/convertCellData.ts b/packages/nc-gui/composables/useMultiSelect/convertCellData.ts index e827b3ee89..7fee2febc1 100644 --- a/packages/nc-gui/composables/useMultiSelect/convertCellData.ts +++ b/packages/nc-gui/composables/useMultiSelect/convertCellData.ts @@ -48,8 +48,12 @@ export default function convertCellData( // e.g. 2023-05-09T19:41:49+08:00 -> 2023-05-09 11:41:49 return parsedDateTime.utc().format(isMysql ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD HH:mm:ssZ') } - // External DB - keep it as it is - return parsedDateTime.format(isMysql ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD HH:mm:ssZ') + // External DB + if (isMysql) { + // convert back to utc + return parsedDateTime.utc().format('YYYY-MM-DD HH:mm:ss') + } + return parsedDateTime.format('YYYY-MM-DD HH:mm:ssZ') } case UITypes.Time: { let parsedTime = dayjs(value)