Closed rusticdeity closed 4 years ago
Thanks for reporting this bug. The change was made to differentiate between defined and undefined startingDate
since moment(undefined) returns today's date. I have pushed a fix for this and will publish a new version.
BTW -- the way you created the date results in two Moment constructors plus a JS Date constructor:
moment(moment().startOf('week')).toDate()
That could be simplified to moment().startOf('week')
.
The corner case you reported is still valid because startingDate should support non-Moment input including "YYYY-MM-DD" strings.
When I was using version 1.4.1 I was able to pass in a startingDate prop as
startingDate={moment(moment().startOf('week')).toDate()}
which is breaking with an error _.clone is not a function. from version 2.0.0. If this is a change that was made consciously then please update the documentation. Snack is here.