-3

I had a Date Picker Dialogue in which i need to show current date in that dialogue and the previous dates should be disabled and should be shown in the date picker dialogue.Only future dates should be shown not previous date in date picker dialogue

Vish
  • 11
  • 2

2 Answers2

0

Take a look at setMinDate method of DatePicker.

Rajesh
  • 15,724
  • 7
  • 46
  • 95
0

You should use setMinDate() and setMaxDate() methods of DatePicker class.

  1. This will disable all previous dates prior to current date, but you can also set any other date. Just remember to calculate this date in milliseconds from epoch

    datePickerDialog().getDatePicker().setMinDate(System.currentTimeMillis());
    
  2. And this will disable all dates after today

    datePickerDialog().getDatePicker().setMaxDate(System.currentTimeMillis());