diff --git a/src/framework/ui/calendar/baseCalendar.component.tsx b/src/framework/ui/calendar/baseCalendar.component.tsx index 95ece7f2d..01de9ba09 100644 --- a/src/framework/ui/calendar/baseCalendar.component.tsx +++ b/src/framework/ui/calendar/baseCalendar.component.tsx @@ -174,20 +174,22 @@ export abstract class BaseCalendarComponent extends React.Component { - const pagerRef: React.RefObject> = this.getCurrentPagerRef(); - - pagerRef.current.scrollToIndex({ - index: pagerRef.current.props.selectedIndex - 1, - animated: true, + const newDate = this.dateService.createDate( + this.dateService.getYear(this.state.visibleDate), + this.dateService.getMonth(this.state.visibleDate) - 1, + this.dateService.getDate(this.state.visibleDate)); + this.setState({ + visibleDate: newDate, }); }; private onHeaderNavigationRightPress = (): void => { - const pagerRef: React.RefObject> = this.getCurrentPagerRef(); - - pagerRef.current.scrollToIndex({ - index: pagerRef.current.props.selectedIndex + 1, - animated: true, + const newDate = this.dateService.createDate( + this.dateService.getYear(this.state.visibleDate), + this.dateService.getMonth(this.state.visibleDate) + 1, + this.dateService.getDate(this.state.visibleDate)); + this.setState({ + visibleDate: newDate, }); };