Skip to content

Commit

Permalink
Fix a bug in choosing what month's calendars to display, and better h…
Browse files Browse the repository at this point in the history
…ighlighting of the selected date range
  • Loading branch information
dangrossman committed Jul 16, 2015
1 parent a7b9ccd commit 4a224f0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion daterangepicker.css
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,9 @@
cursor: pointer;
}

.daterangepicker td.off {
.daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date {
color: #999;
background: #fff;
}

.daterangepicker td.disabled, .daterangepicker option.disabled {
Expand Down
11 changes: 5 additions & 6 deletions daterangepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,17 +486,16 @@

updateMonthsInView: function() {
if (this.endDate) {
this.leftCalendar.month = this.startDate.clone().day(1);
this.leftCalendar.month = this.startDate.clone().date(2);
if (this.endDate.month() != this.startDate.month() || this.endDate.year() != this.startDate.year()) {
this.rightCalendar.month = this.endDate.clone().day(1);
this.rightCalendar.month = this.endDate.clone().date(2);
} else {
this.rightCalendar.month = this.startDate.clone().day(1).add(1, 'month');
this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month');
}
} else {
if (this.leftCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM') && this.rightCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM')) {
console.log('here2');
this.leftCalendar.month = this.startDate.clone().day(1);
this.rightCalendar.month = this.startDate.clone().day(1).add(1, 'month');
this.leftCalendar.month = this.startDate.clone().date(2);
this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month');
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion website.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

<h1 style="margin: 0 0 20px 0">Date Range Picker</h1>
<p style="font-size: 18px">
A JavaScript dropdown for choosing date ranges.
A JavaScript component for choosing date ranges.
<br />
Designed to work with the Bootstrap CSS framework.
</p>
Expand Down

0 comments on commit 4a224f0

Please sign in to comment.