File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1- /* eslint no-fallthrough: 0 */
1+ /* eslint no-fallthrough: off */
22import dateMath from 'date-arithmetic' ;
33import localizer from '../localizer' ;
44
Original file line number Diff line number Diff line change 1+ import invariant from 'invariant' ;
12import { navigate } from './constants' ;
3+ import VIEWS from '../Views' ;
24
35export default function moveDate ( action , date , View ) {
4- switch ( action ) {
6+ View = typeof view === 'string' ? VIEWS [ View ] : View ;
7+
8+ switch ( action ) {
59 case navigate . TODAY :
610 date = new Date ( )
711 break ;
812 case navigate . DATE :
913 break ;
1014 default :
15+ invariant ( View && typeof View . navigate === 'function' ,
16+ 'Calendar View components must implement a static `.navigate(date, action)` method.s' )
1117 date = View . navigate ( date , action )
1218 }
13-
1419 return date
1520}
You can’t perform that action at this time.
0 commit comments