Employee Shift Scheduling
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.
Employee Shift Scheduling
Use the summary mode of the timeline view with eventDisplay: 'fill' that can be configured under the timeline settings of the view option.
This will give you summarized daily events similar to the event calendar labels where each event is printed under the appropriate day, time slot (shift) for the appropriate resource one after the other.
Build a custom add/edit dialog with the necessary fields. The event dialog can be fully custom as seen in this CRUD example.
Customize the dialog header with a custom template using the headerTemplate option.
Demo

Code
import { CommonModule } from '@angular/common';
import { Component, ViewChild } from '@angular/core';
import { FormsModule } from '@angular/forms';
import {
formatDate,
MbscCalendarEvent,
MbscDatepickerValue,
MbscEventcalendarView,
MbscEventClickEvent,
MbscEventCreatedEvent,
MbscEventDeletedEvent,
MbscEventUpdatedEvent,
MbscModule,
MbscPopup,
MbscPopupButton,
MbscPopupOptions,
MbscResource,
MbscSlot,
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('popup', { static: false })
popup!: MbscPopup;
deletedShift!: MbscCalendarEvent;
isEdit = false;
minTime = '';
maxTime = '';
shift!: MbscCalendarEvent;
shiftDates?: MbscDatepickerValue;
shiftNotes?: string;
headerPrimary = '';
headerDate = '';
popupButtons: (MbscPopupButton | 'cancel')[] = [];
popupResponsive: Record<string, MbscPopupOptions> = {
medium: {
display: 'center',
fullScreen: false,
touchUi: false,
width: 400,
},
};
staff: MbscResource[] = [
{
id: 1,
name: 'Ryan',
color: '#e20000',
title: 'Cloud System Engineer',
img: 'https://img.mobiscroll.com/demos/m1.png',
},
{
id: 2,
name: 'Kate',
color: '#60e81a',
title: 'Help Desk Specialist',
img: 'https://img.mobiscroll.com/demos/f1.png',
},
{
id: 3,
name: 'John',
color: '#3ba7ff',
title: 'Application Developer',
img: 'https://img.mobiscroll.com/demos/m2.png',
},
{
id: 4,
name: 'Mark',
color: '#e25dd2',
title: 'Network Administrator',
img: 'https://img.mobiscroll.com/demos/m3.png',
},
{
id: 5,
name: 'Sharon',
color: '#f1e920',
title: 'Data Quality Manager',
img: 'https://img.mobiscroll.com/demos/f2.png',
},
{
id: 6,
name: 'Emma',
color: '#1ac38d',
title: 'Product Tactics Agent',
img: 'https://img.mobiscroll.com/demos/f3.png',
},
{
id: 7,
name: 'Michael',
color: '#f18a1a',
title: 'UX Designer',
img: 'https://img.mobiscroll.com/demos/m4.png',
},
{
id: 8,
name: 'Laura',
color: '#7b61ff',
title: 'DevOps Engineer',
img: 'https://img.mobiscroll.com/demos/f4.png',
},
];
shifts: MbscCalendarEvent[] = [
{
start: '2026-10-27T07:00',
end: '2026-10-27T13:00',
title: '07:00 - 13:00',
resource: 1,
slot: 1,
},
{
start: '2026-10-27T07:00',
end: '2026-10-27T13:00',
title: '07:00 - 13:00',
resource: 7,
slot: 1,
},
{
start: '2026-10-27T12:00',
end: '2026-10-27T18:00',
title: '12:00 - 18:00',
resource: 3,
slot: 2,
},
{
start: '2026-10-27T12:00',
end: '2026-10-27T18:00',
title: '12:00 - 18:00',
resource: 8,
slot: 2,
},
{
start: '2026-10-28T07:00',
end: '2026-10-28T13:00',
title: '07:00 - 13:00',
resource: 4,
slot: 1,
},
// Showing partial data. Download full source.
];
myView: MbscEventcalendarView = {
timeline: {
type: 'week',
eventDisplay: 'fill',
startDay: 1,
endDay: 5,
},
};
getShiftTimes(event: MbscCalendarEvent) {
const d = event.start as Date;
const start = new Date(d.getFullYear(), d.getMonth(), d.getDate(), event.slot === 1 ? 7 : 12);
const end = new Date(d.getFullYear(), d.getMonth(), d.getDate(), event.slot === 1 ? 13 : 18);
return {
title: formatDate('HH:mm', start) + ' - ' + formatDate('HH:mm', end),
start: start,
end: end,
};
}
fillPopup(event: MbscCalendarEvent, isEdit: boolean) {
this.isEdit = isEdit;
this.minTime = event.slot === 1 ? '07:00' : '12:00';
this.maxTime = event.slot === 1 ? '13:00' : '18:00';
this.shift = event;
this.shiftDates = [new Date(event.start as Date), new Date(event.end as Date)];
this.shiftNotes = event['notes'];
}
deleteEvent(event: MbscCalendarEvent) {
this.shifts = this.shifts.filter((s) => s.id !== event.id);
this.notify.snackbar({
button: {
action: () => {
this.shifts = [...this.shifts, event];
},
text: 'Undo',
},
message: 'Shift deleted',
});
}
updateEvent(event: MbscCalendarEvent) {
const index = this.shifts.findIndex((s) => s.id === event.id);
const newShifts = [...this.shifts];
newShifts.splice(index, 1, event);
this.shifts = newShifts;
}
saveEvent(event: MbscCalendarEvent) {
const dates = this.shiftDates as Date[];
const start = dates[0];
const end = dates[1] ? dates[1] : dates[0];
const shiftStart = new Date(event.start as Date);
const shiftEnd = new Date(event.end as Date);
shiftStart.setHours(start.getHours(), start.getMinutes(), 0, 0);
shiftEnd.setHours(end.getHours(), end.getMinutes(), 0, 0);
event.start = shiftStart;
event.end = shiftEnd;
event.title = formatDate('HH:mm', start) + ' - ' + formatDate('HH:mm', end);
event['notes'] = this.shiftNotes;
if (this.isEdit) {
this.updateEvent(event);
} else {
// Add the new event to the list
this.shifts = [...this.shifts, event];
}
this.popup.close();
}
handleEventClick(args: MbscEventClickEvent) {
const event = args.event;
const resource = args.resourceObj!;
const slot = args.slotObj!;
this.fillPopup(event, true);
this.popupButtons = [
'cancel',
{
handler: () => {
this.saveEvent(event);
},
keyCode: 'enter',
text: 'Save',
cssClass: 'mbsc-popup-button-primary',
},
];
this.headerPrimary = 'Edit ' + resource.name + "'s hours";
this.headerDate =
formatDate('DDDD', new Date(event.start as Date)) + ' ' + slot.name + ', ' + formatDate('D MMMM YYYY', new Date(event.start as Date));
this.popup.open();
}
handleEventCreated(args: MbscEventCreatedEvent) {
setTimeout(() => {
const event = args.event;
const slot = args.slotObj!;
this.fillPopup(event, false);
this.popupButtons = [
'cancel',
{
handler: () => {
this.saveEvent(event);
},
keyCode: 'enter',
text: 'Add',
cssClass: 'mbsc-popup-button-primary',
},
];
this.headerPrimary = 'New shift';
this.headerDate =
formatDate('DDDD', new Date(event.start as Date)) +
' ' +
slot.name +
', ' +
formatDate('D MMMM YYYY', new Date(event.start as Date));
this.popup.open();
});
}
handleEventCreateFailed() {
this.notify.toast({ message: "Can't create shift" });
}
handleEventDeleted(args: MbscEventDeletedEvent) {
setTimeout(() => {
this.deleteEvent(args.event);
});
}
handleEventUpdated(args: MbscEventUpdatedEvent) {
setTimeout(() => {
const shift = args.event;
if (shift.slot !== args.oldEvent!.slot) {
const data = this.getShiftTimes(shift);
shift.start = data.start;
shift.end = data.end;
shift.title = data.title;
this.updateEvent(shift);
}
});
}
handleEventUpdateFailed() {
this.notify.toast({ message: "Can't move shift" });
}
handlePopupClose() {
if (!this.isEdit) {
// Remove event if popup is cancelled
this.shifts = [...this.shifts];
}
}
handleShiftDeleteClick() {
this.deleteEvent(this.shift);
this.popup.close();
}
}
<mbsc-eventcalendar
class="mds-employee-shifts"
[clickToCreate]="true"
[dragToCreate]="false"
[dragToResize]="false"
[dragToMove]="true"
[data]="shifts"
[eventOverlap]="false"
[extendDefaultEvent]="getShiftTimes"
[invalid]="myInvalids"
[resources]="staff"
[resourceTemplate]="myResourceTemplate"
[slots]="mySlots"
[view]="myView"
(onEventClick)="handleEventClick($event)"
(onEventCreated)="handleEventCreated($event)"
(onEventCreateFailed)="handleEventCreateFailed()"
(onEventDeleted)="handleEventDeleted($event)"
(onEventUpdated)="handleEventUpdated($event)"
(onEventUpdateFailed)="handleEventUpdateFailed()"
>
<ng-template #myResourceTemplate let-resource>
<div class="mbsc-flex">
<img class="mds-employee-shifts-avatar" [attr.alt]="resource.name" [src]="resource.img" />
<div class="mds-employee-shifts-cont">
<div class="mds-employee-shifts-name">{{resource.name}}</div>
<div class="mds-employee-shifts-title">{{resource.title}}</div>
</div>
</div>
</ng-template>
</mbsc-eventcalendar>
<mbsc-popup
#popup
display="bottom"
[buttons]="popupButtons"
[contentPadding]="false"
[fullScreen]="true"
[headerTemplate]="myHeaderTemplate"
[responsive]="popupResponsive"
[scrollLock]="false"
(onClose)="handlePopupClose()"
>
<mbsc-datepicker
display="anchored"
select="range"
timeWheels="|h:mm A|"
[controls]="['time']"
[minTime]="minTime"
[maxTime]="maxTime"
[showRangeLabels]="false"
[stepMinute]="30"
[startInput]="start"
[endInput]="end"
[touchUi]="false"
[(ngModel)]="shiftDates"
/>
<div class="mbsc-form-group">
<mbsc-input #start [dropdown]="true" label="Shift start"></mbsc-input>
<mbsc-input #end [dropdown]="true" label="Shift end"></mbsc-input>
</div>
<div class="mbsc-form-group">
<mbsc-textarea label="Notes" [(ngModel)]="shiftNotes"></mbsc-textarea>
</div>
<div *ngIf="isEdit" class="mbsc-button-group">
<mbsc-button class="mbsc-button-block" color="danger" variant="outline" (click)="handleShiftDeleteClick()"> Delete shift </mbsc-button>
</div>
</mbsc-popup>
<ng-template #myHeaderTemplate>
<div class="mds-employee-shifts-header-primary">{{ headerPrimary }}</div>
<div class="mds-employee-shifts-header-date">{{ headerDate }}</div>
</ng-template>
.mds-employee-shifts-header-primary {
font-size: 16px;
line-height: 20px;
}
.mds-employee-shifts-header-date {
font-size: 14px;
font-weight: 600;
line-height: 20px;
opacity: 0.6;
}
.mds-employee-shifts .mbsc-timeline-resource-col {
width: 200px;
}
.mds-employee-shifts .mbsc-schedule-event-inner {
text-align: center;
height: 36px;
line-height: 36px;
}
.mds-employee-shifts-cont {
padding: 0 7px;
}
.mds-employee-shifts-name {
font-size: 14px;
line-height: 24px;
}
.mds-employee-shifts-title {
font-size: 12px;
font-weight: 400;
line-height: 16px;
}
.mds-employee-shifts-avatar {
width: 40px;
height: 40px;
}