From 258e18895c942b167e546babdcfeac066e177a6f Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 28 May 2022 14:51:55 +0530 Subject: [PATCH] fix: ignore timezone mysql and rely on project info for checking datasource client type re #1048 Signed-off-by: Pranav C --- .../components/editableCell/DateTimePickerCell.vue | 6 ++++-- .../components/editableCell/TimePickerCell.vue | 13 ++++++++++++- packages/nc-gui/store/project.js | 3 +++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/components/project/spreadsheet/components/editableCell/DateTimePickerCell.vue b/packages/nc-gui/components/project/spreadsheet/components/editableCell/DateTimePickerCell.vue index 4e9d631689..07abd59972 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/editableCell/DateTimePickerCell.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/editableCell/DateTimePickerCell.vue @@ -32,17 +32,19 @@ export default { value: [String, Date, Number], ignoreFocus: Boolean }, computed: { + isMysql() { + return ['mysql', 'mysql2'].indexOf(this.$store.getters['project/GtrClientType']) + }, localState: { get() { if (!this.value) { return this.value } - return (/^\d+$/.test(this.value) ? dayjs(+this.value) : dayjs(this.value)) .format('YYYY-MM-DD HH:mm') }, set(value) { - if (this.$parent.sqlUi.name === 'MysqlUi') { + if (this.isMysql) { this.$emit('input', value && dayjs(value).format('YYYY-MM-DD HH:mm:ss')) } else { this.$emit('input', value && dayjs(value).format('YYYY-MM-DD HH:mm:ssZ')) diff --git a/packages/nc-gui/components/project/spreadsheet/components/editableCell/TimePickerCell.vue b/packages/nc-gui/components/project/spreadsheet/components/editableCell/TimePickerCell.vue index 92dbe8d1b6..dff16cd47b 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/editableCell/TimePickerCell.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/editableCell/TimePickerCell.vue @@ -15,6 +15,7 @@