0

I want to disable the holidays date in the DatePickerDialog . Please suggest me how could i do this.Here is my code..

     dateJourney = new DatePickerDialog.OnDateSetListener() {

        @Override
        public void onDateSet(DatePicker view, int year, int monthOfYear,
                int dayOfMonth) {
            myCalendar.set(Calendar.YEAR, year);
            myCalendar.set(Calendar.MONTH, monthOfYear);
            myCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth);
            updateLabel(inputJReportDate);

        }
    };
Abdulla Nilam
  • 31,770
  • 15
  • 58
  • 79

2 Answers2

0

You can achieve list of holidays from google api:- https://stackoverflow.com/a/19048193/1384010

Once you need that list, you just need to disable them in your picker.

Community
  • 1
  • 1
Adarsh Yadav
  • 3,644
  • 3
  • 20
  • 45
0

It's not possible, the best we could do is set Max and Min date for the date picker.

Or maybe you could create your own custom date picker to enable this.(Using NumberPicker for example)

Sagar Limbani
  • 299
  • 1
  • 13