Browse Source

feat(nc-gui): set picker to DatePicker

pull/6870/head
աɨռɢӄաօռɢ 1 year ago
parent
commit
d1ee09c22d
  1. 4
      packages/nc-gui/components/cell/DatePicker.vue

4
packages/nc-gui/components/cell/DatePicker.vue

@ -15,6 +15,7 @@ import {
useSelectedCellKeyupListener,
watch,
} from '#imports'
import { isDateMonthFormat } from '~/utils'
interface Props {
modelValue?: string | null
@ -45,6 +46,8 @@ const isDateInvalid = ref(false)
const dateFormat = computed(() => parseProp(columnMeta?.value?.meta)?.date_format ?? 'YYYY-MM-DD')
const picker = computed(() => (isDateMonthFormat(dateFormat.value) ? 'month' : ''))
const localState = computed({
get() {
if (!modelValue) {
@ -215,6 +218,7 @@ const clickHandler = () => {
<template>
<a-date-picker
v-model:value="localState"
:picker="picker"
:bordered="false"
class="!w-full !px-1 !border-none"
:class="{ 'nc-null': modelValue === null && showNull }"

Loading…
Cancel
Save