'Separate event block to events by interval in full calendar
app.component.ts
@ViewChild('calendar') calendarComponent: FullCalendarComponent = <FullCalendarComponent>{};
calendarOptions: CalendarOptions = {
initialView: 'timeGridDay',
slotDuration: "00:15:00",
slotLabelInterval: "00:15:00",
defaultTimedEventDuration: "00:15:00",
selectable: true,
select: this.selectHandler.bind(this),
eventClick: this.eventClickHandler.bind(this),
selectOverlap: false,
};
constructor() {
}
selected: any;
private selectHandler(dateSelectArg: DateSelectArg) {
this.selected = dateSelectArg;
}
private eventClickHandler(event: EventClickArg) {
console.log(event.event)
}
addEvent() {
this.calendarComponent.getApi().addEvent(this.selected)
}
Need: select an event (from 6:45 to 9:00), after adding it, I need separate events by my interval (6:45-7:00, 7:15:7:30...) for current example interval is 00:15mm.
is
should be
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|