Sridhar Arumugam
2016-04-06 f999087af0b246e9d06a3a6ccab1e11eabafa551
changed the onClick function for year and month based on updateOn props
2 files modified
12 ■■■■ changed files
src/MonthsView.js 6 ●●●● patch | view | raw | blame | history
src/YearsView.js 6 ●●●● patch | view | raw | blame | history
src/MonthsView.js
@@ -37,7 +37,7 @@
                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() ));
@@ -53,6 +53,10 @@
        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 ] );
    }
src/YearsView.js
@@ -38,7 +38,7 @@
                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() ));
@@ -55,6 +55,10 @@
        return rows;
    },
    updateSelectedYear: function( event ) {
        this.props.updateSelectedDate(event, true);
    },
    renderYear: function( props, year, selectedDate ){
        return DOM.td( props, year );
    }