mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-04 18:27:17 +00:00
feat: default date/datetime value as current date
This commit is contained in:
@@ -10,7 +10,7 @@ interface Props {
|
||||
|
||||
const { modelValue, isPk, isUpdatedFromCopyNPaste } = defineProps<Props>()
|
||||
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
const emit = defineEmits(['update:modelValue', 'currentDate'])
|
||||
|
||||
const timeFormatsObj = {
|
||||
[timeFormats[0]]: 'hh:mm A',
|
||||
@@ -425,6 +425,11 @@ const cellValue = computed(
|
||||
localState.value?.format(parseProp(column.value.meta).is12hrFormat ? timeFormatsObj[timeFormat.value] : timeFormat.value) ??
|
||||
'',
|
||||
)
|
||||
|
||||
const currentDate = ($event) => {
|
||||
open.value = false
|
||||
emit('currentDate', $event)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -510,7 +515,9 @@ const cellValue = computed(
|
||||
:is-open="isOpen"
|
||||
type="date"
|
||||
size="medium"
|
||||
:show-current-date-option="isEditColumn"
|
||||
@update:selected-date="handleSelectDate"
|
||||
@current-date="currentDate"
|
||||
/>
|
||||
|
||||
<template v-else>
|
||||
@@ -520,7 +527,9 @@ const cellValue = computed(
|
||||
is-min-granularity-picker
|
||||
:is12hr-format="!!parseProp(column.meta).is12hrFormat"
|
||||
:is-open="isOpen"
|
||||
:show-current-date-option="isEditColumn"
|
||||
@update:selected-date="handleSelectTime"
|
||||
@current-date="currentDate"
|
||||
/>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user