--- jquery.ui.datepicker.orig.js 2010-03-23 15:38:46.000000000 -0500 +++ jquery.ui.datepicker.js 2010-03-23 15:39:16.000000000 -0500 @@ -695,6 +695,35 @@ if (inst == $.datepicker._curInst && $.datepicker._datepickerShowing && inst.input && inst.input.is(':visible') && !inst.input.is(':disabled')) inst.input.focus(); + + var stepMonths = this._get(inst, 'stepMonths'); + + inst.dpDiv.find('select.ui-datepicker-month, select.ui-datepicker-year').click(function() { + window['DP_jQuery_' + dpuuid].datepicker._clickMonthYear('#' + inst.id); + }).change(function() { + window['DP_jQuery_' + dpuuid].datepicker._selectMonthYear('#' + inst.id, this, $(this).hasClass('ui-datepicker-month') ? 'M' : 'Y'); + }); + + inst.dpDiv.find('button.ui-datepicker-close').click(function() { + window['DP_jQuery_' + dpuuid].datepicker._hideDatepicker(); + }); + + inst.dpDiv.find('button.ui-datepicker-current').click(function() { + window['DP_jQuery_' + dpuuid].datepicker._gotoToday('#' + inst.id); + }) + + inst.dpDiv.find('.ui-datepicker-next:not(.ui-state-disabled)').click(function() { + window['DP_jQuery_' + dpuuid].datepicker._adjustDate('#' + inst.id, +stepMonths, 'M'); + }); + + inst.dpDiv.find('.ui-datepicker-prev:not(.ui-state-disabled)').click(function() { + window['DP_jQuery_' + dpuuid].datepicker._adjustDate('#' + inst.id, -stepMonths, 'M'); + }); + + inst.dpDiv.find('.ui-datepicker-calendar tr > td:not(.ui-datepicker-week-col, .ui-state-disabled)').click(function() { + window['DP_jQuery_' + dpuuid].datepicker._selectDay('#' + inst.id, inst.drawMonth, inst.drawYear, this); + return false; + }); }, /* Retrieve the size of left and top borders for an element. @@ -1386,8 +1415,7 @@ this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), this._getFormatConfig(inst))); var prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? - '' + prevText + '' : (hideIfNoPrevNext ? '' : '' + prevText + '')); var nextText = this._get(inst, 'nextText'); @@ -1395,19 +1423,17 @@ this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), this._getFormatConfig(inst))); var next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? - '' + nextText + '' : (hideIfNoPrevNext ? '' : '' + nextText + '')); var currentText = this._get(inst, 'currentText'); var gotoDate = (this._get(inst, 'gotoCurrent') && inst.currentDay ? currentDate : today); currentText = (!navigationAsDateFormat ? currentText : this.formatDate(currentText, gotoDate, this._getFormatConfig(inst))); - var controls = (!inst.inline ? '' : ''); + var controls = (!inst.inline ? '' : ''); var buttonPanel = (showButtonPanel) ? '
' + (isRTL ? controls : '') + - (this._isInRange(inst, gotoDate) ? '' : '') + (isRTL ? '' : controls) + '
' : ''; var firstDay = parseInt(this._get(inst, 'firstDay'),10); firstDay = (isNaN(firstDay) ? 0 : firstDay); @@ -1482,9 +1508,7 @@ (otherMonth && !showOtherMonths ? '' : ' ' + daySettings[1] + // highlight custom dates (printDate.getTime() == currentDate.getTime() ? ' ' + this._currentClass : '') + // highlight selected day (printDate.getTime() == today.getTime() ? ' ui-datepicker-today' : '')) + '"' + // highlight today (if different) - ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + // cell title - (unselectable ? '' : ' onclick="DP_jQuery_' + dpuuid + '.datepicker._selectDay(\'#' + - inst.id + '\',' + printDate.getMonth() + ',' + printDate.getFullYear() + ', this);return false;"') + '>' + // actions + ((!otherMonth || showOtherMonths) && daySettings[2] ? ' title="' + daySettings[2] + '"' : '') + '>' + // cell title (otherMonth && !showOtherMonths ? ' ' : // display for other months (unselectable ? '' + printDate.getDate() + '' : ''; + monthHtml += ''; + html += '