rc-calendar
Advanced tools
Comparing version 1.5.1 to 1.5.2
@@ -33,2 +33,6 @@ # rc-calendar@1.x demo Calendar.Picker | ||
handleChange:function(value){ | ||
console.log('DatePicker change: '+(this.props.formatter.format(value))); | ||
}, | ||
handleCalendarSelect: function (v) { | ||
@@ -73,3 +77,4 @@ //console.log('outer knows: ' + this.props.formatter.format(v)); | ||
<div className="input-group"> | ||
<DatePicker ref='picker' formatter={this.props.formatter} calendar={calendar} value={state.value}> | ||
<DatePicker ref='picker' formatter={this.props.formatter} calendar={calendar} | ||
value={state.value} onChange={this.handleChange}> | ||
<input type="text" className="form-control" style={{background:'white',cursor:'pointer'}}/> | ||
@@ -76,0 +81,0 @@ </DatePicker> |
@@ -20,5 +20,11 @@ /** @jsx React.DOM */ | ||
var Picker = React.createClass({ | ||
propTypes: { | ||
onChange: React.PropTypes.func | ||
}, | ||
getDefaultProps: function () { | ||
return { | ||
prefixCls: 'rc-calendar-picker', | ||
onChange: function () { | ||
}, | ||
formatter: new DateTimeFormat('yyyy-MM-dd', require('gregorian-calendar/lib/locale/en-us')) | ||
@@ -58,2 +64,3 @@ }; | ||
var self = this; | ||
var currentValue = this.state.value; | ||
if (this.props.calendar.props.showTime) { | ||
@@ -71,2 +78,5 @@ this.setState({ | ||
} | ||
if (!currentValue || currentValue.getTime() !== value.getTime()) { | ||
self.props.onChange(value); | ||
} | ||
}, | ||
@@ -73,0 +83,0 @@ |
{ | ||
"name": "rc-calendar", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"description": "calendar ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -177,2 +177,8 @@ # rc-calendar | ||
</tr> | ||
<tr> | ||
<td>onChange</td> | ||
<td>Function/td> | ||
<td></td> | ||
<td>called when select a different value</td> | ||
</tr> | ||
</tbody> | ||
@@ -179,0 +185,0 @@ </table> |
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
130242
3050
215