diff --git a/components/date_picker/Calendar.jsx b/components/date_picker/Calendar.jsx index 97c5b70d6..086b5a8e0 100644 --- a/components/date_picker/Calendar.jsx +++ b/components/date_picker/Calendar.jsx @@ -1,7 +1,7 @@ import React from 'react'; import CssTransitionGroup from 'react-addons-css-transition-group'; import { SlideLeft, SlideRight } from '../animations'; -import FontIcon from '../font_icon'; +import { IconButton } from '../button'; import Ripple from '../ripple'; import CalendarMonth from './CalendarMonth'; import time from '../utils/time'; @@ -50,19 +50,10 @@ class Calendar extends React.Component { this.props.onChange(viewDate); }; - incrementViewMonth = () => { - this.refs.rippleRight.start(event); + changeViewMonth = (direction, step) => { this.setState({ - direction: 'right', - viewDate: time.addMonths(this.state.viewDate, 1) - }); - }; - - decrementViewMonth = () => { - this.refs.rippleLeft.start(event); - this.setState({ - direction: 'left', - viewDate: time.addMonths(this.state.viewDate, -1) + direction, + viewDate: time.addMonths(this.state.viewDate, step) }); }; @@ -92,12 +83,8 @@ class Calendar extends React.Component { const animation = this.state.direction === 'left' ? SlideLeft : SlideRight; return (