aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.datepicker.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/jquery.ui.datepicker.js')
-rw-r--r--ui/jquery.ui.datepicker.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js
index 45107c969..aeadde4ee 100644
--- a/ui/jquery.ui.datepicker.js
+++ b/ui/jquery.ui.datepicker.js
@@ -529,6 +529,13 @@ $.extend(Datepicker.prototype, {
$.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
@@ -1395,6 +1402,14 @@ $.extend(Datepicker.prototype, {
if (inst.input) {
inst.input.val(clear ? '' : this._formatDate(inst));
}
+
+ var onSelect = this._get(inst, 'onSelect');
+ if (onSelect) {
+ var dateStr = this._formatDate(inst);
+
+ // trigger custom callback
+ onSelect.apply((inst.input ? inst.input[0] : null), [dateStr, inst]);
+ }
},
/* Retrieve the date(s) directly. */