simulate('keydown', {keyCode: $.simulate.VK_ESC});
equals(selectedDate, $.datepicker.formatDate('mm/dd/yy', date),
'Callback selected date - esc');
+ var dateStr = '02/04/2008';
+ inp.val(dateStr).datepicker('show').
+ simulate('keydown', {keyCode: $.simulate.VK_ENTER});
+ equals(dateStr, selectedDate,
+ 'onSelect is called after enter keydown');
// onChangeMonthYear
inp.datepicker('option', {onChangeMonthYear: callback2, onSelect: null}).
val('').datepicker('show');
$.datepicker._currentClass + ')', inst.dpDiv);
if (sel[0])
$.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0]);
+ var onSelect = $.datepicker._get(inst, 'onSelect');
+ if (onSelect) {
+ var dateStr = $.datepicker._formatDate(inst);
+
+ // trigger custom callback
+ onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
+ }
else
$.datepicker._hideDatepicker();
return false; // don't submit the form