Reputation: 809
I'm using the better pickers library (here's the link) to select date in my application. I want to set limits to the picker such that the max date is today's date and the minimum date is not more than one year ago. Here's my code to display the CalendarDatePickerDialogFragment dialog;
private void showDateDialog() {
FragmentManager fm = getSupportFragmentManager();
DateTime now = DateTime.now();
CalendarDatePickerDialogFragment calendarDatePickerDialogFragment = CalendarDatePickerDialogFragment
.newInstance(this, now.getYear(), now.getMonthOfYear() - 1,
now.getDayOfMonth());
calendarDatePickerDialogFragment.show(fm, FRAG_TAG_DATE_PICKER);
}
Upvotes: 0
Views: 342
Reputation: 1090
Upvotes: 1