Skip to content

Commit d3a100f

Browse files
authored
Add events on user date selection (not confirmed)
Add two event `selected.date.start` & `selected.date.end` when user click on date. Note : if `autoApply`, there's no `selected.date.end` trigger
1 parent 8495717 commit d3a100f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

daterangepicker.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,6 +1324,8 @@
13241324
}
13251325
this.endDate = null;
13261326
this.setStartDate(date.clone());
1327+
1328+
this.element.trigger('selected.date.start', this);
13271329
} else if (!this.endDate && date.isBefore(this.startDate)) {
13281330
//special case: clicking the same date for start/end,
13291331
//but the time of the end date is before the start date
@@ -1349,6 +1351,8 @@
13491351
if (this.autoApply) {
13501352
this.calculateChosenLabel();
13511353
this.clickApply();
1354+
} else {
1355+
this.element.trigger('selected.date.end', this);
13521356
}
13531357
}
13541358

0 commit comments

Comments
 (0)