|
|
@ -24,7 +24,7 @@ const { modelValue, isPk } = defineProps<Props>() |
|
|
|
|
|
|
|
|
|
|
|
const emit = defineEmits(['update:modelValue']) |
|
|
|
const emit = defineEmits(['update:modelValue']) |
|
|
|
|
|
|
|
|
|
|
|
const { isMysql, isSqlite } = useProject() |
|
|
|
const { isMysql, isSqlite, isXcdbBase } = useProject() |
|
|
|
|
|
|
|
|
|
|
|
const { showNull } = useGlobal() |
|
|
|
const { showNull } = useGlobal() |
|
|
|
|
|
|
|
|
|
|
@ -55,7 +55,7 @@ let localState = $computed({ |
|
|
|
return undefined |
|
|
|
return undefined |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (isSqlite(column.value.base_id)) { |
|
|
|
if (isXcdbBase(column.value.base_id) && isSqlite(column.value.base_id)) { |
|
|
|
return /^\d+$/.test(modelValue) |
|
|
|
return /^\d+$/.test(modelValue) |
|
|
|
? dayjs(+modelValue) |
|
|
|
? dayjs(+modelValue) |
|
|
|
.utc(true) |
|
|
|
.utc(true) |
|
|
@ -72,6 +72,7 @@ let localState = $computed({ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (val.isValid()) { |
|
|
|
if (val.isValid()) { |
|
|
|
|
|
|
|
if (isXcdbBase(column.value.base_id)) { |
|
|
|
if (isMysql(column.value.base_id)) { |
|
|
|
if (isMysql(column.value.base_id)) { |
|
|
|
emit('update:modelValue', val?.format('YYYY-MM-DD HH:mm:ss')) |
|
|
|
emit('update:modelValue', val?.format('YYYY-MM-DD HH:mm:ss')) |
|
|
|
} else if (isSqlite(column.value.base_id)) { |
|
|
|
} else if (isSqlite(column.value.base_id)) { |
|
|
@ -79,6 +80,10 @@ let localState = $computed({ |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
emit('update:modelValue', dayjs(val).utc().format('YYYY-MM-DD HH:mm:ssZ')) |
|
|
|
emit('update:modelValue', dayjs(val).utc().format('YYYY-MM-DD HH:mm:ssZ')) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// TODO(timezone): keep ext db as it is |
|
|
|
|
|
|
|
emit('update:modelValue', val?.format(isMysql(column.value.base_id) ? 'YYYY-MM-DD HH:mm:ss' : 'YYYY-MM-DD HH:mm:ssZ')) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|