Skip to content

Commit

Permalink
fix: set endDate to last time of day in RangeDatePicker
Browse files Browse the repository at this point in the history
  • Loading branch information
mia committed Feb 27, 2024
1 parent 009d6a7 commit 4e39e6f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,19 @@ export const RangePickerField = withRangePickerFieldVariation(
return;
}

const endOfEndDate = new Date(new Date(endDate).setHours(23, 59, 59, 999));

let isPrevented = false;

onValueChangeRef.current?.({
value: { start: startDate, end: endDate },
value: { start: startDate, end: endOfEndDate },
prevent: () => {
isPrevented = true;
},
});

if (!isPrevented) {
setValue({ start: startDate, end: endDate });
setValue({ start: startDate, end: endOfEndDate });
}

setIsCalendarOpened(false);
Expand Down

0 comments on commit 4e39e6f

Please sign in to comment.