onefinestay/react-daterange-picker

Start date is not highlighted when setting date range externally

Opened this issue · 2 comments

The demo page contains example for the "Setting Calendar Range Externally"
image

Pressing "Last 7 days" range is set from September 24, 2019 to October 1, 2019 but "24" is not highlighted in the component.

I assume first date of the range should be included to the visual selection.

When setting in the component directly - everything is highlighted correctly for the same range.
image

@vicacid

I have crosscheck their official demo source code (not sandbox one, and it's a bad example) and they have used moment startOf, below is a workable single date selection example using endOf:

value={moment.range(moment().startOf('day'), moment().endOf('day'))}