From 5578559ca8db629c508569f3187dd2212c4b7bb4 Mon Sep 17 00:00:00 2001 From: Jason Quense Date: Thu, 12 Jan 2017 15:46:15 -0500 Subject: [PATCH] [fixed] all day event selection --- src/Calendar.js | 2 -- src/TimeGrid.js | 25 +++++++++++++------------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/Calendar.js b/src/Calendar.js index bce089cd0..af8cc92c6 100644 --- a/src/Calendar.js +++ b/src/Calendar.js @@ -8,10 +8,8 @@ import { , dateRangeFormat , views as componentViews } from './utils/propTypes'; -import localizer from './localizer' import { notify } from './utils/helpers'; import { navigate, views } from './utils/constants'; -import dates from './utils/dates'; import defaultFormats from './formats'; import viewLabel from './utils/viewLabel'; import moveDate from './utils/move'; diff --git a/src/TimeGrid.js b/src/TimeGrid.js index fa8507fe9..e9fe84d9d 100644 --- a/src/TimeGrid.js +++ b/src/TimeGrid.js @@ -121,6 +121,15 @@ export default class TimeGrid extends Component { } } + handleSelectAllDaySlot = (slots) => { + const { onSelectSlot } = this.props; + notify(onSelectSlot, { + slots, + start: slots[0], + end: slots[slots.length - 1] + }) + } + render() { let { events @@ -213,22 +222,13 @@ export default class TimeGrid extends Component { } renderHeader(range, events, width) { - let { messages, rtl, onSelectSlot, selectable, components } = this.props; + let { messages, rtl, selectable, components } = this.props; let { isOverflowing } = this.state || {}; let style = {}; if (isOverflowing) style[rtl ? 'marginLeft' : 'marginRight'] = scrollbarSize() + 'px'; - function handleSelectSlot({ start, end }) { - let slots = range.slice(start, end + 1) - notify(onSelectSlot, { - slots, - start: slots[0], - end: slots[slots.length - 1] - }) - } - return (
+ culture={culture} + />
)