Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into babel_upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
jkimbo committed May 3, 2015
2 parents 72e208d + 5dbc55d commit 2f874da
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions dist/DateRangePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ var DateRangePicker = _React2['default'].createClass({
initialFromValue: _React2['default'].PropTypes.bool,
showLegend: _React2['default'].PropTypes.bool,
onSelect: _React2['default'].PropTypes.func,
onSelectStart: _React2['default'].PropTypes.func,
paginationArrowComponent: _React2['default'].PropTypes.func,
value: function value(props, propName, componentName) {
var val = props[propName];
Expand Down Expand Up @@ -225,6 +226,9 @@ var DateRangePicker = _React2['default'].createClass({
this.setState({
selectedStartDate: date
});
if (typeof this.props.onSelectStart === 'function') {
this.props.onSelectStart(_moment2['default'](date));
}
},

statesForRange: function statesForRange(range) {
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@
"type": "git",
"url": "https://github.com/onefinestay/react-daterange-picker"
},
"peerDependencies": {
"react": ">=0.12.0"
},
"dependencies": {
"calendar": "^0.1.0",
"immutable": "^3.6.2",
"moment": "^2.8.3",
"moment-range": "^1.0.5",
"react": "^0.12.0"
"moment-range": "^1.0.5"
},
"devDependencies": {
"babel-core": "^5.2.6",
Expand Down
4 changes: 4 additions & 0 deletions src/DateRangePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var DateRangePicker = React.createClass({
initialFromValue: React.PropTypes.bool,
showLegend: React.PropTypes.bool,
onSelect: React.PropTypes.func,
onSelectStart: React.PropTypes.func,
paginationArrowComponent: React.PropTypes.func,
value: function(props, propName, componentName) {
var val = props[propName];
Expand Down Expand Up @@ -192,6 +193,9 @@ var DateRangePicker = React.createClass({
this.setState({
selectedStartDate: date
});
if (typeof(this.props.onSelectStart) === 'function') {
this.props.onSelectStart(moment(date));
}
},

statesForRange(range) {
Expand Down

0 comments on commit 2f874da

Please sign in to comment.