Not sure what I am doing incorrectly. I add my datepicker class when the page loads.
$(function()
{
$( ".datepicker" ).datepicker({changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd", yearRange: "2002:"});
});
I want to change my datepicker class to
$( ".datepicker" ).datepicker({changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd", yearRange: "2010:"});
On event I remove the class then unbind the datepicker, then rebind.
$("#datefield").removeClass("datepicker hasDatepicker");
$('#datefield').unbind();
$('#datefield').bind();
//rebind
$("#datefield").datepicker();
how can I rebind the new datepicker? I've removed the datepicker class then re-added the class. Nothing seems to work.
$("#datefield").datepicker({changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd", yearRange: "1998:"});. How can I add this using a class?