fix: use correct property names from getActiveDateRange
getActiveDateRange returns { start, end } not { startDate, endDate }.
Also pass currentDate to avoid undefined date calculations.
This commit is contained in:
@@ -122,10 +122,10 @@ watch(
|
||||
|
||||
// If rangeType changes without dateRange, recompute dates from the range
|
||||
if (!newDateRange && newRangeType !== CUSTOM_RANGE) {
|
||||
const activeDates = getActiveDateRange(newRangeType);
|
||||
const activeDates = getActiveDateRange(newRangeType, currentDate.value);
|
||||
if (activeDates) {
|
||||
selectedStartDate.value = startOfDay(activeDates.startDate);
|
||||
selectedEndDate.value = endOfDay(activeDates.endDate);
|
||||
selectedStartDate.value = startOfDay(activeDates.start);
|
||||
selectedEndDate.value = endOfDay(activeDates.end);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user