Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resourceId to onSelecting callback #1416

Merged
merged 1 commit into from
Oct 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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