Skip to content

Commit 1e1d089

Browse files
authored
Merge pull request #1714 from jbrowning/fix_callback_start_end_references
Clone start/end dates before passing to callback
2 parents 9670cb0 + 54f0e68 commit 1e1d089

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

daterangepicker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@
11391139

11401140
//if a new date range was selected, invoke the user callback function
11411141
if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate))
1142-
this.callback(this.startDate, this.endDate, this.chosenLabel);
1142+
this.callback(this.startDate.clone(), this.endDate.clone(), this.chosenLabel);
11431143

11441144
//if picker is attached to a text input, update it
11451145
this.updateElement();

0 commit comments

Comments
 (0)