From 1b594cdb71bb3bbf4642468c1b8a9295ae5c78d3 Mon Sep 17 00:00:00 2001 From: michalak111 Date: Mon, 14 Oct 2019 15:21:10 +0200 Subject: [PATCH] feat: add resourceId to onSelecting callback (#1416) --- src/Calendar.js | 3 ++- src/DayColumn.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Calendar.js b/src/Calendar.js index b7c59e382..0111d180b 100644 --- a/src/Calendar.js +++ b/src/Calendar.js @@ -269,6 +269,7 @@ class Calendar extends React.Component { * slotInfo: { * start: Date, * end: Date, + * resourceId: (number|string), * slots: Array, * action: "select" | "click" | "doubleClick", * bounds: ?{ // For "select" action @@ -317,7 +318,7 @@ class Calendar extends React.Component { * Returning `false` from the handler will prevent a selection. * * ```js - * (range: { start: Date, end: Date }) => ?boolean + * (range: { start: Date, end: Date, resourceId: (number|string) }) => ?boolean * ``` */ onSelecting: PropTypes.func, diff --git a/src/DayColumn.js b/src/DayColumn.js index 03c5681b5..0bd09a0a9 100644 --- a/src/DayColumn.js +++ b/src/DayColumn.js @@ -249,7 +249,7 @@ class DayColumn extends React.Component { if ( (dates.eq(current.startDate, start, 'minutes') && dates.eq(current.endDate, end, 'minutes')) || - onSelecting({ start, end }) === false + onSelecting({ start, end, resourceId: this.props.resource }) === false ) return }