Browse Source

feat(nc-gui): datetime logic for mssql

pull/5601/head
Wing-Kam Wong 2 years ago
parent
commit
ba77ca157c
  1. 7
      packages/nc-gui/components/cell/DateTimePicker.vue

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

@ -25,7 +25,7 @@ const { modelValue, isPk, isUpdateOutside } = defineProps<Props>()
const emit = defineEmits(['update:modelValue']) const emit = defineEmits(['update:modelValue'])
const { isMysql, isSqlite, isXcdbBase } = useProject() const { isMssql, isMysql, isSqlite, isXcdbBase } = useProject()
const { showNull } = useGlobal() const { showNull } = useGlobal()
@ -58,6 +58,11 @@ let localState = $computed({
return undefined return undefined
} }
if (isMssql(column.value.base_id)) {
// e.g. 2023-04-29T11:41:53.000Z
return dayjs(modelValue)
}
// 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) {

Loading…
Cancel
Save