Search code examples
extjsextjs4extjs4.1extjs4.2extjs-mvc

ExtJS 4.2 DatePicker get the first day and last day in the calendar


I have an ExtJS datepicker where I disable some dates so the user can't select them.

After the calendar is renderer I send to the server the current date and the server sends back an array of days to disable, so the visual result is the following:

enter image description here

The problem I have is that I don't know the first and last day showed in the datepicker.

In this image the first day is 08/31/2014 and the last day is 09/11/2014. How can I get those dates, so I can tell my server to check if within that range I have to disable any date.

In the calendar example the "yellow marked dates" have to been disabled.

enter image description here

Any clue? Appreciate in advance.


Solution

  • Check this fiddle: https://fiddle.sencha.com/#fiddle/8ms

    this uses minDate, maxDate with disabledDates, disabledDays combination..to enable particular days and disable all other days.