react-datetime icon indicating copy to clipboard operation
react-datetime copied to clipboard

Pass cloned date to `isValidDate` to render days

Open rmanganiello opened this issue 5 years ago • 1 comments

Description

Avoid rendering days side effects by cloning the date to be verified against the isValidDate function.

Motivation and Context

This solves an important issue in the library, if for some reason you mutate the input date in the isValidDate function, the renderDay method will render the mutated date instead of the original.

Checklist

[x] I have not included any built dist files (us maintainers do that prior to a new release)
[ ] I have added tests covering my changes
[x] All new and existing tests pass
[ ] My changes required the documentation to be updated
  [ ] I have updated the documentation accordingly
  [ ] I have updated the TypeScript 1.8 type definitions accordingly
  [ ] I have updated the TypeScript 2.0+ type definitions accordingly

rmanganiello avatar Jan 14 '21 16:01 rmanganiello

Gentle ping:

@arqex @simeg @layneanderson

rmanganiello avatar Nov 09 '21 13:11 rmanganiello