Add, Edit and Delete Events
Usage
theme: 'ios' You can turn auto theming on and let it decide based on the platform.
Usage
themeVariant: 'light' You can turn auto dark mode on based on system settings.
Usage
clickToCreate: true,
// click to create is on dragToCreate: true,
// drag to create is on dragToMove: true,
// reordering is on dragToResize: true,
// resizing is on eventDelete: true
// deleting is on Fine-tune drag & drop with these options, which are false by default.
Usage
locale: localeEn Selecting the locale loads the localized settings and the translated UI text.
Add, Edit and Delete Events
Drag to create and click to create is enabled. Events can be created by dragging or with double clicks. As soon as the initial position is confirmed, a temporary event is created and a custom edit dialog is shown for refinement. On cancel the temporary event will be removed and on confirmation the event will stay in the calendar.
Edit existing eventsDrag to resize and drag to move is enabled. Events can be reordered and resized. In addition to that, clicking on the event will open a custom dialog that enables editing the various properties.
Delete eventsDelete can be implemented inside the edit dialog with a button. It's just a matter of removing it from the data object. If a dialog is not shown on click, focused events can be deleted with the backspace and delete keys.
Demo

Code
import { CommonModule } from '@angular/common';
import { Component, ViewChild } from '@angular/core';
import { FormsModule } from '@angular/forms';
import {
MbscCalendarEvent,
MbscDateType,
MbscEventcalendar,
MbscEventcalendarView,
MbscEventClickEvent,
MbscEventCreatedEvent,
MbscModule,
MbscPopup,
MbscPopupButton,
MbscPopupOptions,
MbscResponsiveOptions,
Notifications,
setOptions ,
} from '@mobiscroll/angular';
setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
providers: [Notifications],
standalone: true,
imports: [CommonModule, FormsModule, MbscModule],
})
export class AppComponent {
constructor(private notify: Notifications) {}
@ViewChild('calendar', { static: false })
calendar!: MbscEventcalendar;
@ViewChild('addEditPopup', { static: false })
addEditPopup!: MbscPopup;
@ViewChild('colorPicker', { static: false })
colorPicker!: MbscPopup;
eventId: string | number | undefined;
eventTitle: string | undefined;
eventDescription = '';
eventAllDay = false;
eventDates: MbscDateType[] = [];
eventBuffer = 0;
eventColor = '';
eventStatus = false;
selectedColor = '';
statusValue = 'busy';
editedEvent: MbscCalendarEvent | null = null;
addEditPopupAnchor: HTMLElement | undefined;
colorPickerAnchor: HTMLElement | undefined;
isEdit = false;
isSuccess = false;
myView: MbscEventcalendarView = { calendar: { labels: true } };
colors: string[] = ['#ffeb3c', '#ff9900', '#f44437', '#ea1e63', '#9c26b0', '#3f51b5', '', '#009788', '#4baf4f', '#7e5d4e'];
myEvents: MbscCalendarEvent[] = [
{
id: 1,
start: '2026-10-08T13:00',
end: '2026-10-08T13:45',
title: "Lunch @ Butcher's",
description: '',
allDay: false,
bufferBefore: 15,
free: true,
color: '#009788',
},
{
id: 2,
start: '2026-10-20T15:00',
end: '2026-10-20T16:00',
title: 'Conference',
description: '',
allDay: false,
bufferBefore: 30,
free: false,
color: '#ff9900',
},
{
id: 3,
start: '2026-10-19T18:00',
end: '2026-10-19T22:00',
title: 'Site Visit',
description: '',
allDay: false,
bufferBefore: 60,
free: true,
color: '#3f51b5',
},
{
id: 4,
start: '2026-10-21T10:30',
end: '2026-10-21T11:30',
title: 'Stakeholder mtg.',
description: '',
allDay: false,
free: false,
color: '#f44437',
},
];
editButtons: (MbscPopupButton | 'ok' | 'close' | 'set' | 'cancel')[] = [
'cancel',
{
text: 'Save',
keyCode: 'enter',
cssClass: 'mbsc-popup-button-primary',
handler: () => {
const updatedEvent: MbscCalendarEvent = this.getEventData();
const index = this.myEvents.findIndex((x) => x.id === updatedEvent.id);
const newEventList = [...this.myEvents];
// Update event in the list
newEventList.splice(index, 1, updatedEvent);
this.myEvents = newEventList;
this.calendar.navigateToEvent(updatedEvent);
this.addEditPopup.close();
},
},
];
addButtons: (MbscPopupButton | 'ok' | 'close' | 'set' | 'cancel')[] = [
'cancel',
{
text: 'Add',
keyCode: 'enter',
cssClass: 'mbsc-popup-button-primary',
handler: () => {
const newEvent: MbscCalendarEvent = this.getEventData();
// Add new event to the list
this.myEvents = [...this.myEvents, newEvent];
this.isSuccess = true;
this.calendar.navigateToEvent(newEvent);
this.addEditPopup.close();
},
},
];
addEditPopupResponsive: MbscResponsiveOptions<MbscPopupOptions> = {
medium: {
display: 'anchored',
width: 400,
fullScreen: false,
touchUi: false,
},
};
colorPickerButtons: (MbscPopupButton | 'ok' | 'close' | 'set' | 'cancel')[] = [
'cancel',
{
text: 'Set',
keyCode: 'enter',
handler: () => this.applySelectedColor(this.selectedColor),
cssClass: 'mbsc-popup-button-primary',
},
];
colorPickerResponsive: MbscResponsiveOptions<MbscPopupOptions> = {
medium: {
display: 'anchored',
buttons: [],
touchUi: false,
},
};
fillPopup(event: MbscCalendarEvent): void {
this.eventId = event.id;
this.eventTitle = event.title || '';
this.eventDescription = event['description'] || '';
this.eventAllDay = event.allDay!;
this.eventDates = [event.start!, event.end!];
this.eventBuffer = event.bufferBefore || 0;
this.eventColor = event.color || '';
this.eventStatus = event['free'] || false;
this.statusValue = event['free'] ? 'free' : 'busy';
}
createEditPopup(event: MbscCalendarEvent, target: HTMLElement): void {
this.isEdit = true;
this.editedEvent = event;
this.addEditPopupAnchor = target;
this.fillPopup(event);
this.addEditPopup.open();
}
createAddPopup(event: MbscCalendarEvent, target: HTMLElement): void {
this.isSuccess = false;
this.isEdit = false;
this.editedEvent = event;
this.addEditPopupAnchor = target;
this.fillPopup({ ...event, allDay: false });
this.addEditPopup.open();
}
getEventData(): MbscCalendarEvent {
return {
id: this.eventId,
title: this.eventTitle,
description: this.eventDescription,
allDay: this.eventAllDay,
start: this.eventDates[0],
end: this.eventDates[1],
bufferBefore: this.eventBuffer,
color: this.eventColor,
free: this.statusValue === 'free',
};
}
handleAddEditPopupClose(): void {
if (!this.isEdit && !this.isSuccess) {
// Refresh the list, if add popup was canceled, to remove the temporary event
this.myEvents = [...this.myEvents];
}
}
handleEventClick(args: MbscEventClickEvent): void {
this.createEditPopup(args.event, args.domEvent.currentTarget);
}
handleEventCreated(args: MbscEventCreatedEvent): void {
setTimeout(() => {
this.createAddPopup(args.event, args.target!);
});
}
handleEventDeleted() {
this.notify.snackbar({
button: {
action: () => {
this.myEvents = [...this.myEvents, this.editedEvent!];
},
text: 'Undo',
},
message: 'Event deleted',
});
}
handleDeleteButtonClick() {
const filteredEvents = this.myEvents.filter((e) => e.id !== this.editedEvent!.id);
this.myEvents = filteredEvents;
this.addEditPopup.close();
this.notify.snackbar({
button: {
action: () => {
this.myEvents = [...this.myEvents, this.editedEvent!];
},
text: 'Undo',
},
message: 'Event deleted',
});
}
handleEventColorClick(ev: MouseEvent): void {
this.colorPickerAnchor = ev.currentTarget as HTMLElement;
this.colorPicker.open();
}
handleColorChange(ev: MouseEvent): void {
const color = (ev.currentTarget as HTMLDivElement).getAttribute('data-value') || '';
this.eventColor = color;
this.selectedColor = color;
if (!this.colorPicker.s.buttons!.length) {
this.applySelectedColor(color);
}
}
applySelectedColor(color: string): void {
this.eventColor = color;
this.colorPicker.close();
}
}
<mbsc-eventcalendar
#calendar
[data]="myEvents"
[clickToCreate]="true"
[dragToCreate]="true"
[dragToMove]="true"
[dragToResize]="true"
[view]="myView"
(onEventClick)="handleEventClick($event)"
(onEventCreated)="handleEventCreated($event)"
(onEventDeleted)="handleEventDeleted()"
></mbsc-eventcalendar>
<mbsc-popup
#addEditPopup
display="bottom"
[contentPadding]="false"
[fullScreen]="true"
[scrollLock]="false"
[headerText]="isEdit ? 'Edit event' : 'New Event'"
[anchor]="addEditPopupAnchor"
[buttons]="isEdit ? editButtons: addButtons"
[responsive]="addEditPopupResponsive"
(onClose)="handleAddEditPopupClose()"
>
<div class="mbsc-form-group">
<mbsc-input label="Title" [(ngModel)]="eventTitle"></mbsc-input>
<mbsc-textarea label="Description" [(ngModel)]="eventDescription"></mbsc-textarea>
</div>
<div class="mbsc-form-group">
<div>
<mbsc-switch label="All-day" [(ngModel)]="eventAllDay"></mbsc-switch>
<mbsc-datepicker
[(ngModel)]="eventDates"
select="range"
display="anchored"
[touchUi]="true"
[showRangeLabels]="false"
[controls]="eventAllDay ? ['date'] : ['datetime']"
[responsive]="eventAllDay ? { medium: { controls: ['calendar'], touchUi: false } } : { medium: { controls: ['calendar', 'time'], touchUi: false } }"
[startInput]="startInput"
[endInput]="endInput"
></mbsc-datepicker>
<mbsc-input #startInput label="Starts"></mbsc-input>
<mbsc-input #endInput label="Ends"></mbsc-input>
<mbsc-dropdown [(ngModel)]="eventBuffer" label="Travel time" *ngIf="!eventAllDay">
<option value="0">None</option>
<option value="5">5 minutes</option>
<option value="15">15 minutes</option>
<option value="30">30 minutes</option>
<option value="60">1 hour</option>
<option value="90">1.5 hours</option>
<option value="120">2 hours</option>
</mbsc-dropdown>
</div>
<div class="mbsc-flex mds-crud-event-color-cont" (click)="handleEventColorClick($event)">
<div class="mbsc-flex-1-0">Color</div>
<div class="mds-crud-selected-event-color" [ngStyle]="{background: eventColor}"></div>
</div>
<mbsc-segmented-group [(ngModel)]="statusValue">
<mbsc-segmented value="busy">Show as busy</mbsc-segmented>
<mbsc-segmented value="free">Show as free</mbsc-segmented>
</mbsc-segmented-group>
<div *ngIf="isEdit" class="mbsc-button-group">
<mbsc-button class="mbsc-button-block" color="danger" variant="outline" (click)="handleDeleteButtonClick()"
>Delete event
</mbsc-button>
</div>
</div>
</mbsc-popup>
<mbsc-popup
#colorPicker
display="bottom"
[contentPadding]="false"
[showArrow]="false"
[showOverlay]="false"
[anchor]="colorPickerAnchor"
[buttons]="colorPickerButtons"
[responsive]="colorPickerResponsive"
>
<div class="mbsc-flex mds-crud-color-row">
<div *ngFor="let color of colors;let i=index">
<div
*ngIf="i<5"
[class]="'mds-crud-color-value' + (eventColor === color ? ' mds-crud-color-value-selected' : '')"
[attr.data-value]="color"
(click)="handleColorChange($event)"
>
<div class="mds-crud-color mbsc-icon mbsc-font-icon mbsc-icon-material-check" [ngStyle]="{background: color}"></div>
</div>
</div>
</div>
<div class="mbsc-flex mds-crud-color-row">
<div *ngFor="let color of colors;let i=index">
<div
*ngIf="i>=5"
[class]="'mds-crud-color-value' + (eventColor === color ? ' mds-crud-color-value-selected' : '')"
[attr.data-value]="color"
(click)="handleColorChange($event)"
>
<div class="mds-crud-color mbsc-icon mbsc-font-icon mbsc-icon-material-check" [ngStyle]="{background: color}"></div>
</div>
</div>
</div>
</mbsc-popup>
.mds-crud-event-color-cont {
margin: 16px;
align-items: center;
cursor: pointer;
}
.mds-crud-selected-event-color {
width: 30px;
height: 30px;
border-radius: 15px;
margin-right: 10px;
margin-left: 240px;
background: #5ac8fa;
}
.mds-crud-color-row {
justify-content: center;
margin: 5px;
}
.mds-crud-color {
position: relative;
min-width: 46px;
min-height: 46px;
margin: 2px;
cursor: pointer;
border-radius: 23px;
background: #5ac8fa;
}
.mds-crud-color:before {
position: absolute;
top: 50%;
left: 50%;
margin-top: -10px;
margin-left: -10px;
color: #f7f7f7;
font-size: 20px;
text-shadow: 0 0 3px #000;
display: none;
}
.mds-crud-color-value {
padding: 3px;
margin: 2px;
}
.mds-crud-color-value.mds-crud-color-value-selected,
.mds-crud-color-value:hover {
box-shadow: inset 0 0 0 3px #007bff;
border-radius: 48px;
}
.mds-crud-color-value.mds-crud-color-value-selected .mds-crud-color:before {
display: block;
}