Skip to content

Commit

Permalink
feat: add resourceId to onSelecting callback (jquense#1416)
Browse files Browse the repository at this point in the history
  • Loading branch information
michalak111 authored and andrew4699 committed Dec 8, 2019
1 parent 7cdae0d commit 1b594cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ class Calendar extends React.Component {
* slotInfo: {
* start: Date,
* end: Date,
* resourceId: (number|string),
* slots: Array<Date>,
* action: "select" | "click" | "doubleClick",
* bounds: ?{ // For "select" action
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/DayColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 1b594cd

Please sign in to comment.