@@ -9,13 +9,14 @@ import { navigate } from './utils/constants'
99import { inRange } from './utils/eventLevels'
1010import { isSelected } from './utils/selection'
1111
12+ const DEFAULT_LENGTH = 30 ;
1213function Agenda ( {
1314 accessors,
1415 components,
1516 date,
1617 events,
1718 getters,
18- length,
19+ length = DEFAULT_LENGTH ,
1920 localizer,
2021 onDoubleClickEvent,
2122 onSelectEvent,
@@ -217,19 +218,15 @@ Agenda.propTypes = {
217218 selected : PropTypes . object ,
218219}
219220
220- Agenda . defaultProps = {
221- length : 30 ,
222- }
223-
224- Agenda . range = ( start , { length = Agenda . defaultProps . length , localizer } ) => {
221+ Agenda . range = ( start , { length = DEFAULT_LENGTH , localizer } ) => {
225222 let end = localizer . add ( start , length , 'day' )
226223 return { start, end }
227224}
228225
229226Agenda . navigate = (
230227 date ,
231228 action ,
232- { length = Agenda . defaultProps . length , localizer }
229+ { length = DEFAULT_LENGTH , localizer }
233230) => {
234231 switch ( action ) {
235232 case navigate . PREVIOUS :
@@ -243,7 +240,7 @@ Agenda.navigate = (
243240 }
244241}
245242
246- Agenda . title = ( start , { length = Agenda . defaultProps . length , localizer } ) => {
243+ Agenda . title = ( start , { length = DEFAULT_LENGTH , localizer } ) => {
247244 let end = localizer . add ( start , length , 'day' )
248245 return localizer . format ( { start, end } , 'agendaHeaderFormat' )
249246}
0 commit comments