Datepicker’s Today button problem
One of the features of jQuery UI Datepicker is an option (showButtonPanel) which will display two buttons: Today and Done. One would expect that upon clicking the Today button the today date will also be selected and used in input box. Instead, jQuery UI Datepicker simply selects it.
So to make jQuery UI Datepicker also use that date, you can override the _gotoToday function to also set the date to current datetime. I’ve put this into my jquery.ui.js file at the end, so it overrides this function immediately:
var _gotoToday = jQuery.datepicker._gotoToday; jQuery.datepicker._gotoToday = function(a){ var target = jQuery(a); var inst = this._getInst(target[0]); _gotoToday.call(this, a); jQuery.datepicker._selectDate(a, jQuery.datepicker._formatDate(inst,inst.selectedDay, inst.selectedMonth, inst.selectedYear)); }