mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-29 20:16:49 +00:00
fix(nc-gui): revise paste datetime logic
This commit is contained in:
@@ -47,12 +47,22 @@ export default function convertCellData(
|
||||
}
|
||||
if (isXcdbBase) {
|
||||
if (isMysql) {
|
||||
// UTC + 'Z'
|
||||
return `${parsedDateTime.format('YYYY-MM-DD HH:mm:ss')}Z`
|
||||
let res = `${parsedDateTime.format('YYYY-MM-DD HH:mm:ss')}`
|
||||
if (!dayjs.isDayjs(value)) {
|
||||
// UTC + 'Z'
|
||||
res += 'Z'
|
||||
}
|
||||
return res
|
||||
} else if (isMssql) {
|
||||
return parsedDateTime.utc().format('YYYY-MM-DD HH:mm:ssZ')
|
||||
} else {
|
||||
return parsedDateTime.utc(true).format('YYYY-MM-DD HH:mm:ssZ')
|
||||
if (!dayjs.isDayjs(value)) {
|
||||
// e.g. copy the existing cell - 2023-05-06 13:06:51 (UTC)
|
||||
return parsedDateTime.utc(true).format('YYYY-MM-DD HH:mm:ssZ')
|
||||
}
|
||||
// e.g. copy right after setting by datepicker
|
||||
// value includes timezone
|
||||
return parsedDateTime
|
||||
}
|
||||
}
|
||||
// TODO(timezone): keep ext db as it is
|
||||
|
||||
Reference in New Issue
Block a user