0

I read this (jQuery UI DatePicker to show month year only) and this (How to set date of datepicker that displays Month and Year only) style of .ui-datepicker-calendar is set to display:none which is applicable for all pages , however there is single page where user should be able to choose date as well, now if we change the property of .ui-datepicker-calendar from display:none to display:table or display:run-in then user can select date as well for that page but i am unable to change it dynamically using jquery.

I tried like this

$('.ui-datepicker-calendar').css('display','table');
Community
  • 1
  • 1
dEL
  • 482
  • 1
  • 6
  • 23

1 Answers1

0

DatePicker creates the div with class .ui-datepicker-calendar after you set it to display:block in javascript. One option would be to change your css class to something like:

.datePickerMonthAndYear .ui-datepicker-calendar{
    display:none;
}

and then in the beforeShow event of datepicker to add or remove .datePickerMonthAndYear .

See : http://jsfiddle.net/calinaadi/bmsfL4hh/

calinaadi
  • 1,466
  • 1
  • 13
  • 22