From da1d82d31541ea246525c885d9f496e13e0b17b0 Mon Sep 17 00:00:00 2001 From: Tadej Krevh Date: Mon, 21 Feb 2022 10:24:04 +0100 Subject: [PATCH] Fix isClear for singleDatePicker Inside isClear computed property, don't check if endDate is set when using singleDatePicker. Without this fix, the dateRange.startDate does not properly set this.start data property. To reproduce the issue, programmatically toggle the picker with singleDatePicker and initial property without endDate set. You will see that the passed in startDate date and time are not selected in the popup. To verify this issue, if you set the endDate to new Date(), then date and time are properly selected on picker toggle. --- src/components/DateRangePicker.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DateRangePicker.vue b/src/components/DateRangePicker.vue index d37c697..966cd33 100644 --- a/src/components/DateRangePicker.vue +++ b/src/components/DateRangePicker.vue @@ -768,7 +768,7 @@ export default { } }, isClear () { - return !this.dateRange.startDate || !this.dateRange.endDate + return !this.dateRange.startDate || !(this.dateRange.endDate || this.singleDatePicker) }, isDirty () { let origStart = new Date(this.dateRange.startDate)