diff --git a/dist/calendar/CalendarMonth.js b/dist/calendar/CalendarMonth.js index 89bcd2e1..4e3aa741 100644 --- a/dist/calendar/CalendarMonth.js +++ b/dist/calendar/CalendarMonth.js @@ -86,15 +86,23 @@ var CalendarMonth = _reactAddons2['default'].createClass({ var isSelectedRangeStart = undefined; var isSelectedRangeEnd = undefined; - if (!hideSelection && value && _moment2['default'].isMoment(value) && value.isSame(d, 'day')) { - isSelectedDate = true; - } else if (!hideSelection && value && (0, _utilsIsMomentRange2['default'])(value) && value.contains(d)) { + function checkRange() { isInSelectedRange = true; isSelectedRangeStart = value.start.isSame(d, 'day'); isSelectedRangeEnd = value.end.isSame(d, 'day'); } + if (!hideSelection && value && _moment2['default'].isMoment(value) && value.isSame(d, 'day')) { + isSelectedDate = true; + } else if (!hideSelection && value && (0, _utilsIsMomentRange2['default'])(value)) { + if (value.contains(d)) { + checkRange(); + } else if (value.start.isSame(d, 'day')) { + checkRange(); + } + } + return _reactAddons2['default'].createElement(CalendarDate, _extends({ key: i, isToday: d.isSame((0, _moment2['default'])(), 'day'), diff --git a/src/calendar/CalendarMonth.jsx b/src/calendar/CalendarMonth.jsx index 5503f5ab..7fef3518 100644 --- a/src/calendar/CalendarMonth.jsx +++ b/src/calendar/CalendarMonth.jsx @@ -41,15 +41,23 @@ const CalendarMonth = React.createClass({ let isSelectedRangeStart; let isSelectedRangeEnd; - if (!hideSelection && value && moment.isMoment(value) && value.isSame(d, 'day')) { - isSelectedDate = true; - } else if (!hideSelection && value && isMomentRange(value) && value.contains(d)) { + function checkRange() { isInSelectedRange = true; isSelectedRangeStart = value.start.isSame(d, 'day'); isSelectedRangeEnd = value.end.isSame(d, 'day'); } + if (!hideSelection && value && moment.isMoment(value) && value.isSame(d, 'day')) { + isSelectedDate = true; + } else if (!hideSelection && value && isMomentRange(value)) { + if (value.contains(d)) { + checkRange(); + } else if (value.start.isSame(d, 'day')) { + checkRange(); + } + } + return (