rc-calendar
Advanced tools
Comparing version 3.8.1 to 3.8.2
# History | ||
---- | ||
## 3.8.0 / 2015-06-03 | ||
`improved` refactor by split components | ||
## 3.7.0 / 2015-06-01 | ||
@@ -5,0 +9,0 @@ |
@@ -162,2 +162,8 @@ 'use strict'; | ||
function getNow() { | ||
var value = new GregorianCalendar(); | ||
value.setTime(Date.now()); | ||
return value; | ||
} | ||
var Calendar = (function (_React$Component) { | ||
@@ -168,7 +174,3 @@ function Calendar(props) { | ||
_get(Object.getPrototypeOf(Calendar.prototype), 'constructor', this).call(this, props); | ||
var value = props.value || props.defaultValue; | ||
if (!value) { | ||
value = new GregorianCalendar(); | ||
value.setTime(Date.now()); | ||
} | ||
var value = props.value || props.defaultValue || getNow(); | ||
this.dateFormatter = new DateTimeFormat(props.locale.dateFormat); | ||
@@ -207,6 +209,3 @@ this.state = { | ||
if (value !== undefined) { | ||
if (!value) { | ||
value = this.state.value.clone(); | ||
value.setTime(Date.now()); | ||
} | ||
value = value || nextProps.defaultValue || getNow(); | ||
this.setState({ | ||
@@ -213,0 +212,0 @@ value: value |
@@ -74,5 +74,8 @@ 'use strict'; | ||
value: function componentWillReceiveProps(nextProps) { | ||
if (nextProps.value) { | ||
var value = nextProps.value; | ||
if (value !== undefined) { | ||
// null special meaning | ||
value = value || nextProps.defaultValue || null; | ||
this.setState({ | ||
value: nextProps.value | ||
value: value | ||
}); | ||
@@ -79,0 +82,0 @@ } |
{ | ||
"name": "rc-calendar", | ||
"version": "3.8.1", | ||
"version": "3.8.2", | ||
"description": "calendar ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
135070
3890