Skip to content

Range where start and end day are the same #23

@StaySharp0

Description

@StaySharp0

I would like to have a range with the same start and end dates in the RangeDatePicker.
But clicking on the same day did not change anything.

You can satisfy my requirements by changing the following in your code:

public handleDateChange = (actions: PickerAction) => (date: moment.Moment) => {
...
if (!start) {
      startDate = date;
    } else {
      if (end) {
        startDate = date;
        endDate = undefined;
      } else {
//      Original
//      if (isDayAfter(date, start)) { 
         if (!isDayBefore(date, start)) {
          endDate = date;
        } else {
          startDate = date;
        }
      }
    }
...
}

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions