Skip to content

Commit 1d966e6

Browse files
authored
fix(android): re-enable setting max date (#908)
1 parent f2688be commit 1d966e6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

android/src/main/java/com/reactcommunity/rndatetimepicker/RNDatePickerDialogFragment.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,11 @@ private DatePickerDialog createDialog(Bundle args) {
116116
// the date under certain conditions.
117117
datePicker.setMinDate(RNConstants.DEFAULT_MIN_DATE);
118118
}
119-
119+
120+
if (args.containsKey(RNConstants.ARG_MAXDATE)) {
121+
datePicker.setMaxDate(maxDate);
122+
}
123+
120124
// Only compatible with SDK 21 and above
121125
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && args.containsKey(RNConstants.FIRST_DAY_OF_WEEK)) {
122126
final int firstDayOfWeek = args.getInt(RNConstants.FIRST_DAY_OF_WEEK);

0 commit comments

Comments
 (0)