mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-01 19:07:01 +00:00
feat: default date/datetime value as current date
This commit is contained in:
@@ -15,6 +15,7 @@ interface Props {
|
||||
} | null
|
||||
isCellInputField?: boolean
|
||||
pickerType?: 'date' | 'time' | 'year' | 'month'
|
||||
showCurrentDateOption?: boolean
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
@@ -29,7 +30,7 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
isCellInputField: false,
|
||||
pickerType: 'date',
|
||||
})
|
||||
const emit = defineEmits(['update:selectedDate', 'update:pageDate', 'update:selectedWeek', 'update:pickerType'])
|
||||
const emit = defineEmits(['update:selectedDate', 'update:pageDate', 'update:selectedWeek', 'update:pickerType', 'currentDate'])
|
||||
// Page date is the date we use to manage which month/date that is currently being displayed
|
||||
const pageDate = useVModel(props, 'pageDate', emit)
|
||||
|
||||
@@ -250,10 +251,19 @@ const paginate = (action: 'next' | 'prev') => {
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
<div v-if="isCellInputField" class="flex items-center justify-center px-2 pb-2 pt-1">
|
||||
<div v-if="isCellInputField" class="flex items-center justify-center px-2 pb-2 pt-1 gap-2">
|
||||
<NcButton class="nc-date-picker-now-btn !h-7" size="small" type="secondary" @click="handleSelectDate(dayjs())">
|
||||
<span class="text-small"> {{ $t('labels.today') }} </span>
|
||||
</NcButton>
|
||||
<NcButton
|
||||
v-if="showCurrentDateOption"
|
||||
class="nc-date-picker-now-btn !h-7"
|
||||
size="small"
|
||||
type="secondary"
|
||||
@click="emit('currentDate')"
|
||||
>
|
||||
<span class="text-small"> {{ $t('labels.currentDate') }} </span>
|
||||
</NcButton>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user