diff --git a/src/Month.js b/src/Month.js index bdbb691c0..6fb5ab69f 100644 --- a/src/Month.js +++ b/src/Month.js @@ -303,10 +303,14 @@ class MonthView extends React.Component { slots.sort((a, b) => +a - +b) + const start = new Date(slots[0]) + const end = new Date(slots[slots.length - 1]) + end.setDate(slots[slots.length - 1].getDate() + 1) + notify(this.props.onSelectSlot, { slots, - start: slots[0], - end: slots[slots.length - 1], + start, + end, action: slotInfo.action, bounds: slotInfo.bounds, box: slotInfo.box, diff --git a/src/TimeGrid.js b/src/TimeGrid.js index 38676bf3c..507a9cc21 100644 --- a/src/TimeGrid.js +++ b/src/TimeGrid.js @@ -96,10 +96,15 @@ export default class TimeGrid extends Component { handleSelectAllDaySlot = (slots, slotInfo) => { const { onSelectSlot } = this.props + + const start = new Date(slots[0]) + const end = new Date(slots[slots.length - 1]) + end.setDate(slots[slots.length - 1].getDate() + 1) + notify(onSelectSlot, { slots, - start: slots[0], - end: slots[slots.length - 1], + start, + end, action: slotInfo.action, resourceId: slotInfo.resourceId, })