Skip to content

Commit 7c960ff

Browse files
committed
v.1.6.9: trigger change when updating value
Fix: #57
1 parent b495992 commit 7c960ff

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

jquery-ui.multidatespicker.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/*
2-
* MultiDatesPicker v1.6.8
2+
* MultiDatesPicker for jQuery UI
33
* https://dubrox.github.io/Multiple-Dates-Picker-for-jQuery-UI
44
*
5-
* Copyright 2017, Luca Lauretta
5+
* Copyright 2025, Luca Lauretta
66
* Dual licensed under the MIT or GPL version 2 licenses.
77
*/
88

@@ -13,7 +13,7 @@
1313
factory(jQuery);
1414
}
1515
})(function ($) {
16-
$.extend($.ui, { multiDatesPicker: { version: "1.6.8" } });
16+
$.extend($.ui, { multiDatesPicker: { version: "1.6.9" } });
1717

1818
$.fn.multiDatesPicker = function (method) {
1919
var mdp_arguments = arguments;
@@ -228,11 +228,12 @@
228228
var inputs_values = $this.multiDatesPicker("value");
229229

230230
// fills the input field back with all the dates in the calendar
231-
$this.val(inputs_values);
231+
$this.val(inputs_values).trigger("change");
232232

233233
// Fixes the altField filled with defaultDate by default
234234
var altFieldOption = $this.datepicker("option", "altField");
235-
if (altFieldOption) $(altFieldOption).val(inputs_values);
235+
if (altFieldOption)
236+
$(altFieldOption).val(inputs_values).trigger("change");
236237

237238
// Updates the calendar view
238239
$this.datepicker("refresh");
@@ -530,9 +531,9 @@
530531
// @todo: should use altFormat for altField
531532
var dates_string = methods.value.call(this);
532533
if (altField !== undefined && altField != "") {
533-
$(altField).val(dates_string);
534+
$(altField).val(dates_string).trigger("change");
534535
}
535-
$this.val(dates_string);
536+
$this.val(dates_string).trigger("change");
536537

537538
$.datepicker._refreshDatepicker(this);
538539
}

0 commit comments

Comments
 (0)