diff options
author | Felix Nagel <info@felixnagel.com> | 2016-12-11 23:10:46 +0100 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2017-01-21 13:49:35 +0100 |
commit | 8b864309f646f67f7fca88f87a9dea4fe5526aba (patch) | |
tree | 25e68fff40fa50068e6665544b0c63bd09a758eb /ui/widgets/datepicker.js | |
parent | de20614bd7332b740c6ec095e0e5c48c2f97c8bf (diff) | |
download | jquery-ui-8b864309f646f67f7fca88f87a9dea4fe5526aba.tar.gz jquery-ui-8b864309f646f67f7fca88f87a9dea4fe5526aba.zip |
Datepicker: Make select and change event pass the current value
Diffstat (limited to 'ui/widgets/datepicker.js')
-rw-r--r-- | ui/widgets/datepicker.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/ui/widgets/datepicker.js b/ui/widgets/datepicker.js index b489fe9b7..1325434d3 100644 --- a/ui/widgets/datepicker.js +++ b/ui/widgets/datepicker.js @@ -111,14 +111,18 @@ var widget = $.widget( "ui.datepicker", { .calendar( $.extend( {}, this.options, { value: this._parse( this.element.val() ), change: function( event ) { - that._trigger( "change", event ); + that._trigger( "change", event, { + value: that.calendarInstance.valueAsDate() + } ); }, select: function( event ) { that.element.val( that.calendarInstance.value() ); that.close(); event.preventDefault(); that._focusTrigger(); - that._trigger( "select", event ); + that._trigger( "select", event, { + value: that.calendarInstance.valueAsDate() + } ); return false; } @@ -183,7 +187,9 @@ var widget = $.widget( "ui.datepicker", { this.suppressExpandOnFocus = false; }, change: function( event ) { - this._trigger( "change", event ); + this._trigger( "change", event, { + value: this.calendarInstance.valueAsDate() + } ); } }, |