How To Get jQuery UI Datepicker To Insert Today’s Date
erics, Posted May 5th, 2011 at 3:38:56am
Click HERE for the original post.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
// remember the old function var _gotoToday = jQuery.datepicker._gotoToday; // datepicker is directly inside the jQuery object, so override that jQuery.datepicker._gotoToday = function(a){ var target = jQuery(a); var inst = this._getInst(target[0]); // call the old function, so default behaviour is kept _gotoToday.call(this, a); // now do an additional call to _selectDate which will set the date and close // close the datepicker (if it is not inline) jQuery.datepicker._selectDate(a, jQuery.datepicker._formatDate(inst,inst.selectedDay, inst.selectedMonth, inst.selectedYear)); } |
Kenneth said on December 2, 2011, 3:47 am:
Cool ~ Thanks a lot. ^_^