We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 56cc719 commit e43622dCopy full SHA for e43622d
src/DateTimePickerModal.ios.js
@@ -72,7 +72,14 @@ export class DateTimePickerModal extends React.PureComponent {
72
73
static getDerivedStateFromProps(props, state) {
74
if (props.isVisible && !state.isPickerVisible) {
75
- return { currentDate: props.date, isPickerVisible: true };
+ if (props.date < props.minimumDate) {
76
+ console.warn(
77
+ "The date property shouldn't be prior to be the minimum date"
78
+ );
79
+ }
80
+ const smallerDateValue =
81
+ props.date >= props.minimumDate ? props.date : props.minimumDate;
82
+ return { currentDate: smallerDateValue, isPickerVisible: true };
83
}
84
return null;
85
0 commit comments