@@ -198,6 +198,8 @@ return /******/ (function(modules) { // webpackBootstrap
198
198
hideCalendar : this . hideCalendar ,
199
199
minDate : this . props . minDate ,
200
200
maxDate : this . props . maxDate ,
201
+ startDate : this . props . startDate ,
202
+ endDate : this . props . endDate ,
201
203
excludeDates : this . props . excludeDates ,
202
204
weekStart : this . props . weekStart } )
203
205
) ;
@@ -379,6 +381,12 @@ return /******/ (function(modules) { // webpackBootstrap
379
381
return this . _date . isSame ( other . _date , "month" ) ;
380
382
} ;
381
383
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
+
382
390
DateUtil . prototype . day = function ( ) {
383
391
return this . _date . date ( ) ;
384
392
} ;
@@ -562,7 +570,8 @@ return /******/ (function(modules) { // webpackBootstrap
562
570
var minDate = new DateUtil ( this . props . minDate ) . safeClone ( ) ,
563
571
maxDate = new DateUtil ( this . props . maxDate ) . safeClone ( ) ,
564
572
excludeDates ,
565
- disabled ;
573
+ disabled ,
574
+ inRange = day . inRange ( this . props . startDate , this . props . endDate ) ;
566
575
567
576
if ( this . props . excludeDates && Array . isArray ( this . props . excludeDates ) ) {
568
577
excludeDates = map ( this . props . excludeDates , function ( date ) {
@@ -580,6 +589,7 @@ return /******/ (function(modules) { // webpackBootstrap
580
589
date : this . state . date ,
581
590
onClick : this . handleDayClick . bind ( this , day ) ,
582
591
selected : new DateUtil ( this . props . selected ) ,
592
+ inRange : inRange ,
583
593
disabled : disabled } ) ;
584
594
} ,
585
595
@@ -661,11 +671,11 @@ return /******/ (function(modules) { // webpackBootstrap
661
671
662
672
if ( this . props . day . sameDay ( this . props . selected ) ) classes . push ( "datepicker__day--selected" ) ;
663
673
674
+ if ( this . props . day . inRange ) classes . push ( "datepicker__day--in-range" ) ;
675
+
664
676
if ( this . props . day . sameDay ( moment ( ) ) ) classes . push ( "datepicker__day--today" ) ;
665
677
666
- if ( this . isWeekend ( ) ) {
667
- classes . push ( "datepicker__day--weekend" ) ;
668
- }
678
+ if ( this . isWeekend ( ) ) classes . push ( "datepicker__day--weekend" ) ;
669
679
670
680
return React . createElement (
671
681
"div" ,
0 commit comments