Skip to content

Commit f823bd9

Browse files
Add compiled version
1 parent dbe3e50 commit f823bd9

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

dist/react-datepicker.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@
133133
.datepicker__day--today {
134134
font-weight: bold;
135135
}
136-
.datepicker__day--selected {
136+
.datepicker__day--selected, .datepicker__day--in-range {
137137
border-radius: 4px;
138138
background-color: #216ba5;
139139
color: #fff;
140140
}
141-
.datepicker__day--selected:hover {
141+
.datepicker__day--selected:hover, .datepicker__day--in-range:hover {
142142
background-color: #1d5d90;
143143
}
144144
.datepicker__day--disabled {

dist/react-datepicker.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ return /******/ (function(modules) { // webpackBootstrap
198198
hideCalendar: this.hideCalendar,
199199
minDate: this.props.minDate,
200200
maxDate: this.props.maxDate,
201+
startDate: this.props.startDate,
202+
endDate: this.props.endDate,
201203
excludeDates: this.props.excludeDates,
202204
weekStart: this.props.weekStart })
203205
);
@@ -379,6 +381,12 @@ return /******/ (function(modules) { // webpackBootstrap
379381
return this._date.isSame(other._date, "month");
380382
};
381383

384+
DateUtil.prototype.inRange = function (startDate, endDate) {
385+
var startDate = startDate._date.startOf("day").subtract(1, "seconds");
386+
var endDate = endDate._date.startOf("day").add(1, "seconds");
387+
return this._date.isBetween(startDate, endDate);
388+
};
389+
382390
DateUtil.prototype.day = function () {
383391
return this._date.date();
384392
};
@@ -562,7 +570,8 @@ return /******/ (function(modules) { // webpackBootstrap
562570
var minDate = new DateUtil(this.props.minDate).safeClone(),
563571
maxDate = new DateUtil(this.props.maxDate).safeClone(),
564572
excludeDates,
565-
disabled;
573+
disabled,
574+
inRange = day.inRange(this.props.startDate, this.props.endDate);
566575

567576
if (this.props.excludeDates && Array.isArray(this.props.excludeDates)) {
568577
excludeDates = map(this.props.excludeDates, function (date) {
@@ -580,6 +589,7 @@ return /******/ (function(modules) { // webpackBootstrap
580589
date: this.state.date,
581590
onClick: this.handleDayClick.bind(this, day),
582591
selected: new DateUtil(this.props.selected),
592+
inRange: inRange,
583593
disabled: disabled });
584594
},
585595

@@ -661,11 +671,11 @@ return /******/ (function(modules) { // webpackBootstrap
661671

662672
if (this.props.day.sameDay(this.props.selected)) classes.push("datepicker__day--selected");
663673

674+
if (this.props.day.inRange) classes.push("datepicker__day--in-range");
675+
664676
if (this.props.day.sameDay(moment())) classes.push("datepicker__day--today");
665677

666-
if (this.isWeekend()) {
667-
classes.push("datepicker__day--weekend");
668-
}
678+
if (this.isWeekend()) classes.push("datepicker__day--weekend");
669679

670680
return React.createElement(
671681
"div",

dist/react-datepicker.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)