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:
Shivam Mishra
2026-02-06 16:45:18 +05:30
parent 122df392e0
commit 7a1a9fbd9b
@@ -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);
}
}
}