Skip to content

Commit 2922d5b

Browse files
committed
Merge pull request dangrossman#249 from dfmcphee/master
Persisting selected end time when switching to a later start date.
2 parents 26d32cd + c30842a commit 2922d5b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

daterangepicker.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,9 @@
647647
this.endDate = endDate;
648648
} else if (startDate.isAfter(endDate)) {
649649
$(e.target).addClass('active');
650+
var difference = this.endDate.diff(this.startDate);
650651
this.startDate = startDate;
651-
this.endDate = moment(startDate).add('day', 1).startOf('day');
652+
this.endDate = moment(startDate).add('ms', difference);
652653
}
653654

654655
this.leftCalendar.month.month(this.startDate.month()).year(this.startDate.year());

0 commit comments

Comments
 (0)