rc-calendar
Advanced tools
Comparing version 9.11.0 to 9.12.1
@@ -147,3 +147,3 @@ import _classCallCheck from 'babel-runtime/helpers/classCallCheck'; | ||
} | ||
if (startValue && endValue) { | ||
if (startValue || endValue) { | ||
if (isSameDay(current, endValue)) { | ||
@@ -153,2 +153,6 @@ selected = true; | ||
cls += ' ' + selectedEndDateClass; | ||
} else if ((startValue === null || startValue === undefined) && current.isBefore(endValue, 'day')) { | ||
cls += ' ' + inRangeClass; | ||
} else if ((endValue === null || endValue === undefined) && current.isAfter(startValue, 'day')) { | ||
cls += ' ' + inRangeClass; | ||
} else if (current.isAfter(startValue, 'day') && current.isBefore(endValue, 'day')) { | ||
@@ -155,0 +159,0 @@ cls += ' ' + inRangeClass; |
@@ -44,2 +44,9 @@ import _extends from 'babel-runtime/helpers/extends'; | ||
if (end && (start === undefined || start === null)) { | ||
start = end.clone().subtract(1, 'month'); | ||
} | ||
if (start && (end === undefined || end === null)) { | ||
end = start.clone().add(1, 'month'); | ||
} | ||
return [start, end]; | ||
@@ -46,0 +53,0 @@ } |
# History | ||
---- | ||
## 9.12.0 / 2019-03-16 | ||
- RangerPicker support null as start or end | ||
## 9.11.0 / 2019-03-14 | ||
@@ -5,0 +9,0 @@ |
@@ -173,3 +173,3 @@ 'use strict'; | ||
} | ||
if (startValue && endValue) { | ||
if (startValue || endValue) { | ||
if (isSameDay(current, endValue)) { | ||
@@ -179,2 +179,6 @@ selected = true; | ||
cls += ' ' + selectedEndDateClass; | ||
} else if ((startValue === null || startValue === undefined) && current.isBefore(endValue, 'day')) { | ||
cls += ' ' + inRangeClass; | ||
} else if ((endValue === null || endValue === undefined) && current.isAfter(startValue, 'day')) { | ||
cls += ' ' + inRangeClass; | ||
} else if (current.isAfter(startValue, 'day') && current.isBefore(endValue, 'day')) { | ||
@@ -181,0 +185,0 @@ cls += ' ' + inRangeClass; |
@@ -92,2 +92,9 @@ 'use strict'; | ||
if (end && (start === undefined || start === null)) { | ||
start = end.clone().subtract(1, 'month'); | ||
} | ||
if (start && (end === undefined || end === null)) { | ||
end = start.clone().add(1, 'month'); | ||
} | ||
return [start, end]; | ||
@@ -94,0 +101,0 @@ } |
{ | ||
"name": "rc-calendar", | ||
"version": "9.11.0", | ||
"version": "9.12.1", | ||
"description": "React Calendar", | ||
@@ -72,3 +72,3 @@ "keywords": [ | ||
"bootstrap": "~3.3.2", | ||
"dtslint": "^0.3.0", | ||
"dtslint": "^0.5.7", | ||
"enzyme": "^3.3.0", | ||
@@ -75,0 +75,0 @@ "enzyme-adapter-react-16": "^1.1.1", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
1525915
159
23199