Hi Vu,
Sorry for the inconvenience caused.
We can display the break time as a normal event in scheduler UI by making use of cellTemplate property which allows us to customize the cells(slots) based on our requirement. We have achieved your requirement by the below code. Here we are setting the break time is 1 PM to 2 PM.
[app.component.html]
<div class="control-section">
<div class="col-lg-9 content-wrapper">
<ejs-schedule #schedule height='650px' [(selectedDate)]="selectedDate" [eventSettings]="eventSettings" [currentView]='currentView' (renderCell)="onRenerCell($event)">
<ng-template #cellTemplate let-data>
<div class="e-templatewrap" [innerHTML]="isBreak(data.date)"></div>
</ng-template>
<e-views>
<e-view option="TimelineDay"></e-view>
<e-view option="TimelineWeek"></e-view>
<e-view option="TimelineWorkWeek"></e-view>
<e-view option="TimelineMonth"></e-view>
</e-views>
</ejs-schedule>
</div>
</div>
[app.component.ts]
public onRenerCell(args: RenderCellEventArgs) {
if(args.elementType === 'workCells' && args.date.getHours() === 13) {
args.element.classList.add('e-lunch-hours');
}
}
public isBreak(date: Date) {
if(date.getHours() === 13) {
return '<div class="e-break">Break Time</div>';
}
}
[app.component.css]
td.e-work-cells.e-work-hours.e-lunch-hours {
background-color: gray !important;
pointer-events: none;
}
.e-break {
transform: rotate(90deg) translate(30px);
color: white;
}
.e-template-wrap {
height: 100%;
width: 100%;
}
Please refer to the below links for more reference.
Could you please confirm whether the above solution is similar to your requirement?
Regards,
Ravikumar Venkatesan