From 52f09ee0cd05e4f0dc53a76a7e4f64fc6b40ca80 Mon Sep 17 00:00:00 2001 From: Sarah Adams Date: Wed, 30 Jan 2019 14:44:05 -0600 Subject: [PATCH 1/2] Added continuesPrior and continuesAfter props to Event component --- src/EventCell.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/EventCell.js b/src/EventCell.js index 513be0353..b974bf8f7 100644 --- a/src/EventCell.js +++ b/src/EventCell.js @@ -39,6 +39,8 @@ class EventCell extends React.Component { {Event ? ( Date: Mon, 4 Feb 2019 14:33:19 -0600 Subject: [PATCH 2/2] Added slot metrics to custom Events & EventWrappers --- src/EventCell.js | 4 ++++ src/EventRowMixin.js | 4 +++- src/Popup.js | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/EventCell.js b/src/EventCell.js index b974bf8f7..31cfe633e 100644 --- a/src/EventCell.js +++ b/src/EventCell.js @@ -20,6 +20,8 @@ class EventCell extends React.Component { getters, children, components: { event: Event, eventWrapper: EventWrapper }, + slotStart, + slotEnd, ...props } = this.props @@ -44,6 +46,8 @@ class EventCell extends React.Component { title={title} isAllDay={allDay} localizer={localizer} + slotStart={slotStart} + slotEnd={slotEnd} /> ) : ( title diff --git a/src/EventRowMixin.js b/src/EventRowMixin.js index 5e9221715..6c2efb81a 100644 --- a/src/EventRowMixin.js +++ b/src/EventRowMixin.js @@ -52,13 +52,15 @@ export default { onDoubleClick={onDoubleClick} continuesPrior={continuesPrior} continuesAfter={continuesAfter} + slotStart={slotMetrics.first} + slotEnd={slotMetrics.last} selected={isSelected(event, selected)} /> ) }, renderSpan(slots, len, key, content = ' ') { - let per = Math.abs(len) / slots * 100 + '%' + let per = (Math.abs(len) / slots) * 100 + '%' return (
))}