javascript - Mulit jQuery UI Datepickers with different settings -


i trying show more 1 datepicker different settings on 1 page using jquery ui.

//datepicker $("input.date-picker").datepicker({  });  // additional settings $("input.date-picker.multi-calendars").datepicker({    numberofmonths: 3 }); 

"//additional settings" gets ignored , "//datepicker" applied despite setting datepicker show 3 months when has class .multi-calendars.

after hours of digging onto this, found 1 solution. remove class hasdatepicker ui library markerclassname: "hasdatepicker"

this fixed problem, however, month , year dropdown menus not work anymore. when click on dropdown pick date or year whole datepicker closes!

so looked way fix no avail.

is ui datepicker limited? or me missing something?

here live preview: http://loai.directory/test/test - both inputs has label "date picker".

you have use second selector first.

datepicker doesn't allow apply twice on same element, have put specific datepicker selector first more general ones applies datepicker on other dp elements:

// additional settings $("input.date-picker.multi-calendars").datepicker({    numberofmonths: 3 });  //datepicker $("input.date-picker").datepicker({  }); 

Comments