From 5c0e2f876db8acca96802f7c899eb34d1e878f69 Mon Sep 17 00:00:00 2001 From: Vladimir Litvinov Date: Fri, 22 Jan 2021 21:55:23 +0200 Subject: [PATCH] fix(disabled-dates): shorter ts syntax --- src/datepicker/Datepicker.vue | 2 +- src/datepicker/DayPicker.vue | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/datepicker/Datepicker.vue b/src/datepicker/Datepicker.vue index bf03503..05959db 100644 --- a/src/datepicker/Datepicker.vue +++ b/src/datepicker/Datepicker.vue @@ -76,7 +76,7 @@ export default defineComponent({ * Dates not available for picking */ disabledDates: { - type: Object as PropType<{ dates: Date[] | undefined }>, + type: Object as PropType<{ dates?: Date[] }>, required: false, }, /** diff --git a/src/datepicker/DayPicker.vue b/src/datepicker/DayPicker.vue index e0e26e0..5b573e1 100644 --- a/src/datepicker/DayPicker.vue +++ b/src/datepicker/DayPicker.vue @@ -92,7 +92,7 @@ export default defineComponent({ required: false, }, disabledDates: { - type: Object as PropType<{ dates: Date[] | undefined }>, + type: Object as PropType<{ dates?: Date[] }>, required: false, }, }, @@ -135,9 +135,9 @@ export default defineComponent({ const isEnabled = ( target: Date, - lower: Date | undefined, - upper: Date | undefined, - disabledDates: { dates: Date[] | undefined } | undefined + lower?: Date, + upper?: Date, + disabledDates?: { dates?: Date[] } ): boolean => { if (disabledDates?.dates?.some(date => isSameDay(target, date))) return false if (!lower && !upper) return true