You can use such a function in onSelect
function showDateInTitle(picker) { var span = picker.dpDiv[0].querySelector('.ui-datepicker-day'), df, month; if (span === null) { month = picker.dpDiv[0].querySelector('.ui-datepicker-month'); if (!month) return; span = document.createElement('span'); span.setAttribute('class', 'ui-datepicker-day'); df = document.createDocumentFragment(); df.appendChild(span); df.appendChild(document.createTextNode('\u00a0')); month.parentNode.insertBefore( df, month ); } span.textContent = picker.selectedDay; }
The API for the handler is still viewed after the date picker is displayed before making a choice
You can implement afterShow as described here with a little modification to get an instance
$(function() { $.datepicker._updateDatepicker_original = $.datepicker._updateDatepicker; $.datepicker._updateDatepicker = function(inst) { $.datepicker._updateDatepicker_original(inst); var afterShow = this._get(inst, 'afterShow'); if (afterShow) afterShow.apply((inst.input ? inst.input[0] : null), [inst]); } });
Now demo
Paul S.
source share