ShiftRoster
Plans who works which shift.
When to use
- Use it for production, stores and call centers.
Examples
Weekly roster
Loading the example
<k:ShiftRoster start="2026-11-23" days="5" people="Ada Yılmaz,Can Koç,Ece Tan" entries="{path: '/entries', templateShareable: false}" change=".onChange">
<k:shifts>
<k:ShiftType key="d" title="Day" short="08–16" icon="sun" tone="4" need="2"/>
<k:ShiftType key="n" title="Night" short="00–08" icon="moon" tone="3" need="1"/>
</k:shifts>
<k:entries><k:ShiftEntry person="{p}" date="{d}" shift="{s}"/></k:entries>
</k:ShiftRoster>sap.ui.define(["sap/ui/core/mvc/Controller"], (Controller) => Controller.extend("sample.Roster", {
onChange(event) {
const { person, date, shift } = event.getParameters();
const model = this.getView().getModel();
const rest = model.getProperty("/entries").filter((entry) => entry.p !== person || entry.d !== date);
model.setProperty("/entries", shift ? [...rest, { p: person, d: date, s: shift }] : rest);
}
}));API
Properties
| Name | Type | Default | Description |
|---|---|---|---|
label | string | Accessible name | |
start | any | First day as a Date or yyyy-MM-dd | |
days | int | 7 | Number of days |
people | string[] | [] | People |
readOnly | boolean | false | Whether it is display only |
Aggregations
| Name | Type | Description |
|---|---|---|
shifts | ShiftType[] | Shift types |
entries | ShiftEntry[] | Assignments |
Events
| Name | Type | Description |
|---|---|---|
change | person: stringdate: stringshift: string | A cell changed. An empty shift means off. The application updates the data |
ShiftType
A shift type.
Properties
| Name | Type | Default | Description |
|---|---|---|---|
key | string | Key | |
title | string | Name | |
short | string | Short name in the cell | |
time | string | Time range | |
icon | string | Icon, such as sun, sunset, moon or house | |
tone | int | 1 | Color, 1 to 6 |
need | int | 0 | People needed. Zero is not checked |
ShiftEntry
A shift assignment.
Properties
| Name | Type | Default | Description |
|---|---|---|---|
person | string | Person | |
date | any | Day | |
shift | string | Shift key |