hypeserver / react-date-range

A React component for choosing dates and date ranges.
MIT License
2.57k stars 658 forks source link

Pre-defined ranges differ from specified ranges #606

Open ghost opened 1 year ago

ghost commented 1 year ago

Subject of the issue

When selecting a predefined range from the left, the first date is the beginning of the day and the second date is the end of the day. When selecting a range in the calendar the first date is the beginning of the day but the second is now also the beginning of the day. Assuming a range is the first date THROUGH the second date, which is what the interface implies, in my opinion, the second date should always be the end of the day whether specifying it on the left (via pre-defined ranges) or the right (in the calendar.)

[BUG] Bug Reproduce Steps

If someone selects from the calendar today's date by clicking it twice the range is actually just the beginning of today's date to the beginning of today's date which is not a range.

[BUG] Expected behavior

Selecting a start date from the calendar should save the beginning of that day in time and selecting an end date from the calendar should save the end of that day in time. For example, selecting today's date from the calendar by selecting today's date twice should produce a range from the beginning of today's date to the end of today's date.

Environment

Package Version: 1.4.0 React version: 18.2.0 Node version: 16.19.0 Browser: Chrome