hypeserver / react-date-range

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

Single Day Range #546

Open akshayp660 opened 2 years ago

akshayp660 commented 2 years ago

Single Day Range

As we select "today" it gives output startDate: today 12 am to endDate: 11:59 pm but when clicking on another date once, it gives StartDate: respective day 12 Am and endDate: respective day 12 Am the ideal case would have been the same as clicking on today for any other date when clicked once

[BUG] Bug Reproduce Steps

  1. click on today check console log or add log for range in
    onChange(range)=>{
    console.log(range)} 
  2. now click on a different date and see the log you will notice different behavior in this case

[BUG] Expected behavior

when clicked on any date as the start of range it should give output as startDate 12 Am, endDate: 11:59 pm of the respective date this is the case when users just have to select a single day as a range

Environment

Package Version: 1.4.0 React version: 16.13.1 Node version:v16.13.1 Browser: chrome 97.0.4692.71 (Official Build) (64-bit)