Closed auliakbarh closed 3 years ago
@auliakbarh Many changes in commit fba1f3d are tab differences. Please run the linter and remove the tab-only changes. It's unnecessary and makes it difficult to see the true functional changes.
This feature was added in another PR
Thanks @auliakbarh for this PR. I made some tweaks to reduce the redundant setLocale() call, and also fix a bug due to Moment startOf() mutating the original date. https://momentjs.com/docs/#/manipulating/start-of/
This PR will cause the week to move to the selected date's ISO week. That behavior works for the case where
useIsoWeekday
is true. However it will be wrong if the user sets that to false. It should advancestate.startingDate
to the week that contains the newselectedDate
. Another corner case is if both propsstartingDate
andselectedDate
change together. TheselectedDate
update would need to use the new prop value ofstartingDate
instead of from state.