@@ -121,6 +121,15 @@ export default class TimeGrid extends Component {
121
121
}
122
122
}
123
123
124
+ handleSelectAllDaySlot = ( slots ) => {
125
+ const { onSelectSlot } = this . props ;
126
+ notify ( onSelectSlot , {
127
+ slots,
128
+ start : slots [ 0 ] ,
129
+ end : slots [ slots . length - 1 ]
130
+ } )
131
+ }
132
+
124
133
render ( ) {
125
134
let {
126
135
events
@@ -213,22 +222,13 @@ export default class TimeGrid extends Component {
213
222
}
214
223
215
224
renderHeader ( range , events , width ) {
216
- let { messages, rtl, onSelectSlot , selectable, components } = this . props ;
225
+ let { messages, rtl, selectable, components } = this . props ;
217
226
let { isOverflowing } = this . state || { } ;
218
227
219
228
let style = { } ;
220
229
if ( isOverflowing )
221
230
style [ rtl ? 'marginLeft' : 'marginRight' ] = scrollbarSize ( ) + 'px' ;
222
231
223
- function handleSelectSlot ( { start, end } ) {
224
- let slots = range . slice ( start , end + 1 )
225
- notify ( onSelectSlot , {
226
- slots,
227
- start : slots [ 0 ] ,
228
- end : slots [ slots . length - 1 ]
229
- } )
230
- }
231
-
232
232
return (
233
233
< div
234
234
ref = 'headerCell'
@@ -260,7 +260,7 @@ export default class TimeGrid extends Component {
260
260
events = { events }
261
261
className = 'rbc-allday-cell'
262
262
selectable = { selectable }
263
- onSelectSlot = { handleSelectSlot }
263
+ onSelectSlot = { this . handleSelectAllDaySlot }
264
264
dateCellWrapper = { components . dateCellWrapper }
265
265
eventComponent = { this . props . components . event }
266
266
eventWrapperComponent = { this . props . components . eventWrapper }
@@ -296,7 +296,8 @@ export default class TimeGrid extends Component {
296
296
label = { localizer . format ( date , dayFormat , culture ) }
297
297
localizer = { localizer }
298
298
format = { dayFormat }
299
- culture = { culture } />
299
+ culture = { culture }
300
+ />
300
301
</ a >
301
302
</ div >
302
303
)
0 commit comments