File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,9 @@ Change Log: `yii2-date-range`
3
3
4
4
## Version 1.7.2
5
5
6
- ** Date:** 29-Jan -2020
6
+ ** Date:** 09-Feb -2020
7
7
8
+ - (enh #148 ): Correct date range preset dropdown selection for "Today".
8
9
- (enh #147 ): Allow date range picker value to be cleared for preset dropdown.
9
10
- (enh #146 ): Enhance preset dropdown user interface.
10
11
- (enh #143 ): Update initSettings to support indexes .
Original file line number Diff line number Diff line change @@ -315,6 +315,15 @@ public function registerAssets()
315
315
JS ;
316
316
if ($ this ->presetDropdown ) {
317
317
$ js .= <<< JS
318
+ {$ id }.on('apply.daterangepicker', function() {
319
+ var drp = {$ id }.data(' {$ this ->pluginName }'), newValue = drp.startDate.format(drp.locale.format);
320
+ if (!drp.singleDatePicker) {
321
+ newValue += drp.locale.separator + drp.endDate.format(drp.locale.format);
322
+ }
323
+ if (newValue !== {$ input }.val()) {
324
+ {$ input }.val(newValue).trigger('change');
325
+ }
326
+ });
318
327
{$ id }.find('.range-value').attr('placeholder', {$ input }.attr('placeholder'));
319
328
{$ id }.find('.kv-clear').on('click', function(e) {
320
329
e.stopPropagation();
You can’t perform that action at this time.
0 commit comments