Skip to content

Commit

Permalink
Fix a bug when start/end on same date with time picker
Browse files Browse the repository at this point in the history
  • Loading branch information
dangrossman committed Oct 17, 2015
1 parent 90948a8 commit 5f7d061
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion daterangepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1366,8 +1366,11 @@
start.minute(minute);
start.second(second);
this.setStartDate(start);
if (this.singleDatePicker)
if (this.singleDatePicker) {
this.endDate = this.startDate.clone();
} else if (this.endDate && this.endDate.format('YYYY-MM-DD') == start.format('YYYY-MM-DD') && this.endDate.isBefore(start)) {

This comment has been minimized.

Copy link
@asabirov

asabirov Oct 22, 2015

or simpler:
start.isSame(this.endDate, 'day')

this.setEndDate(start.clone());
}
} else if (this.endDate) {
var end = this.endDate.clone();
end.hour(hour);
Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package.describe({
name: 'dangrossman:bootstrap-daterangepicker',
version: '2.1.12',
version: '2.0.14',
summary: 'Date range picker component for Bootstrap',
git: 'https://github.com/dangrossman/bootstrap-daterangepicker',
documentation: 'README.md'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bootstrap-daterangepicker",
"version": "2.1.12",
"version": "2.0.14",
"description": "Date range picker component for Bootstrap",
"main": "daterangepicker.js",
"style": "daterangepicker.css",
Expand Down

0 comments on commit 5f7d061

Please sign in to comment.