hypeserver / react-date-range

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

DateRange: sequence of days and weeks not showing correctly #430

Closed seyaobey closed 3 years ago

seyaobey commented 3 years ago

Subject of the issue

DateRange sequence of days and weeks not showing correctly: the first week keeps repeating. I'm attaching here a screen shot to make my point clear (This is the my first time using this library):

image

[BUG] Bug Reproduce Steps

I have followed the steps described on the online demo: Just drop a DateRange component and configure accordingly

const [state, setState] = useState([
    {
      startDate: new Date(),
      endDate: null,
      key: 'selection'
    }
  ]);
  return <DateRange
    editableDateInputs={false}
    onChange={item => setState([(item as any).selection])}
    moveRangeOnFirstSelection={false}
    ranges={state}
  />;

[BUG] Expected behaviour

It should correctly display a correct sequence of days and weeks in a month

Environment

Package Version: ^1.1.3 React version: ^16.13.1 (typescript 3.8.2) Node version: v14.8.0 Browser: chrome Version 86.0.4240.193 (Official Build) (x86_64), MacOs Catalina 10.15.6

seyaobey commented 3 years ago

there was a mismatch version for date-fns