Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass cloned date to isValidDate to render days #771

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rmanganiello
Copy link

@rmanganiello rmanganiello commented Jan 14, 2021

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

Avoid rendering days side effects by cloning the date to be
verified against the `isValidDate` function.
@rmanganiello rmanganiello force-pushed the fix/avoid-side-effect-rendering-days branch from 597dda0 to 19df87b Compare November 9, 2021 13:06
@rmanganiello
Copy link
Author

Gentle ping:

@arqex @simeg @layneanderson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant