From 84a816147bbc43f5340c7aac14cb67a699506b95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Marius=20L=C3=B8set?= Date: Sun, 19 Nov 2023 21:21:02 +0100 Subject: [PATCH] fix: use DatePickerModel from v-calendar on modelValue Fixes vue-tsc validation errors --- apps/www/src/lib/registry/default/ui/calendar/Calendar.vue | 6 ++---- apps/www/src/lib/registry/new-york/ui/calendar/Calendar.vue | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/www/src/lib/registry/default/ui/calendar/Calendar.vue b/apps/www/src/lib/registry/default/ui/calendar/Calendar.vue index 4657fa60..78fe4304 100644 --- a/apps/www/src/lib/registry/default/ui/calendar/Calendar.vue +++ b/apps/www/src/lib/registry/default/ui/calendar/Calendar.vue @@ -4,6 +4,7 @@ import type { Calendar } from 'v-calendar' import { DatePicker } from 'v-calendar' import { ChevronLeft, ChevronRight } from 'lucide-vue-next' import { computed, nextTick, onMounted, ref } from 'vue' +import type { DatePickerModel } from 'v-calendar/dist/types/src/use/datePicker' import { buttonVariants } from '@/lib/registry/default/ui/button' import { cn } from '@/lib/utils' @@ -12,10 +13,7 @@ defineOptions({ }) const props = withDefaults(defineProps<{ - modelValue?: string | number | Date | Partial<{ - start: Date - end: Date - }> + modelValue?: string | number | Date | DatePickerModel modelModifiers?: object columns?: number type?: 'single' | 'range' diff --git a/apps/www/src/lib/registry/new-york/ui/calendar/Calendar.vue b/apps/www/src/lib/registry/new-york/ui/calendar/Calendar.vue index 6bbf1de4..d462d39a 100644 --- a/apps/www/src/lib/registry/new-york/ui/calendar/Calendar.vue +++ b/apps/www/src/lib/registry/new-york/ui/calendar/Calendar.vue @@ -4,6 +4,7 @@ import type { Calendar } from 'v-calendar' import { DatePicker } from 'v-calendar' import { ChevronLeftIcon, ChevronRightIcon } from '@radix-icons/vue' import { computed, nextTick, onMounted, ref } from 'vue' +import type { DatePickerModel } from 'v-calendar/dist/types/src/use/datePicker' import { buttonVariants } from '@/lib/registry/new-york/ui/button' import { cn } from '@/lib/utils' @@ -12,10 +13,7 @@ defineOptions({ }) const props = withDefaults(defineProps< { - modelValue?: string | number | Date | Partial<{ - start: Date - end: Date - }> + modelValue?: string | number | Date | DatePickerModel modelModifiers?: object columns?: number type?: 'single' | 'range'