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

Does not render minDate and maxDate change #272

Closed
serkanekinci opened this issue Mar 2, 2021 · 2 comments
Closed

Does not render minDate and maxDate change #272

serkanekinci opened this issue Mar 2, 2021 · 2 comments

Comments

@serkanekinci
Copy link

serkanekinci commented Mar 2, 2021

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-calendar-picker@7.0.9 for the project I'm working on because [Insert reason here].

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-calendar-picker/CalendarPicker/index.js b/node_modules/react-native-calendar-picker/CalendarPicker/index.js
index c225330..c1dfb73 100644
--- a/node_modules/react-native-calendar-picker/CalendarPicker/index.js
+++ b/node_modules/react-native-calendar-picker/CalendarPicker/index.js
@@ -74,9 +74,7 @@ export default class CalendarPicker extends Component {
 
     let minMaxDates = {};
-    if (prevProps.minDate !== this.props.minDate ||
-        prevProps.minDate !== this.props.minDate
-    ) {
+    if (prevProps.minDate !== this.props.minDate || prevProps.maxDate !== this.props.maxDate) {
       minMaxDates.minDate = this.props.minDate && moment(this.props.minDate);
       minMaxDates.maxDate = this.props.maxDate && moment(this.props.maxDate);
+
+      doStateUpdate = true
     }

This issue body was partially generated by patch-package.

@serkanekinci serkanekinci changed the title [Replace me] Does not render minDate and maxDate change Mar 2, 2021
@peacechen
Copy link
Collaborator

Thanks @serkanekinci for finding this bug. Please submit a PR.

@peacechen
Copy link
Collaborator

Published in 7.1.1.

To speed up fixes in the future, please submit a PR instead of a patch file.

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

No branches or pull requests

2 participants