Skip to content

Commit

Permalink
Fix to only compare the day for new range calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasTy committed Mar 29, 2024
1 parent 56d5d37 commit 7f8e8c3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function calculateRangeChange<TDate extends PickerValidDate>({
const truthyResult: CalculateRangeChangeResponse<TDate> = allowRangeFlip
? { nextSelection: 'end', newRange: [selectedDate, start!] }
: { nextSelection: 'end', newRange: [selectedDate, null] };
return Boolean(start) && utils.isBefore(selectedDate!, start!)
return Boolean(start) && utils.isBeforeDay(selectedDate!, start!)
? truthyResult
: { nextSelection: 'start', newRange: [start, selectedDate] };
}
Expand Down

0 comments on commit 7f8e8c3

Please sign in to comment.