changed the onClick function for year and month based on updateOn props
| | |
| | | key: i, |
| | | 'data-value': i, |
| | | className: classes, |
| | | onClick: this.props.setDate('month') |
| | | onClick: this.props.updateOn=="month"?this.updateSelectedMonth:this.props.setDate('month') |
| | | }; |
| | | |
| | | months.push( renderer( props, i, year, date && date.clone() )); |
| | |
| | | return rows; |
| | | }, |
| | | |
| | | updateSelectedMonth: function( event ) { |
| | | this.props.updateSelectedDate(event, true); |
| | | }, |
| | | |
| | | renderMonth: function( props, month, year, selectedDate ) { |
| | | return DOM.td( props, this.props.viewDate.localeData()._monthsShort[ month ] ); |
| | | } |
| | |
| | | key: year, |
| | | 'data-value': year, |
| | | className: classes, |
| | | onClick: this.props.setDate('year') |
| | | onClick: this.props.updateOn=="year"?this.updateSelectedYear:this.props.setDate('year') |
| | | }; |
| | | |
| | | years.push( renderer( props, year, selectedDate && selectedDate.clone() )); |
| | |
| | | return rows; |
| | | }, |
| | | |
| | | updateSelectedYear: function( event ) { |
| | | this.props.updateSelectedDate(event, true); |
| | | }, |
| | | |
| | | renderYear: function( props, year, selectedDate ){ |
| | | return DOM.td( props, year ); |
| | | } |