Hi Chin,
Sorry for the inconvenience caused.
We can set different work hours for different resources using setWorkHours public method , and for the same we have prepared a sample which can be viewed from the following link. In the below sample, we have set work hours as your shared details.
- Doctor 2 have different schedule each day.
Monday - 9AM - 5PM
Tuesday - 10AM - 3PM
Friday - 9AM - 3PM
2. Doctor 1 have multiple session/shift in a single day.
Monday - Shift 1 - 9AM - 12PM
Monday - Shift 2 - 1PM - 3PM
Monday - Shift 3 - 8PM - 10PM
let currentDates: Date[] = this.scheduleObj.getCurrentViewDates() as Date[]; //get current view dates
let proxy: any = this;
currentDates.forEach(function(e) {
if (e.getDay() == 1) {
proxy.scheduleObj.setWorkHours([e], "09:00", "12:00", 0);
proxy.scheduleObj.setWorkHours([e], "13:00", "15:00", 0);
proxy.scheduleObj.setWorkHours([e], "20:00", "22:00", 0);
proxy.scheduleObj.setWorkHours([e], "09:00", "17:00", 1);
}
if (e.getDay() == 2) {
proxy.scheduleObj.setWorkHours([e], "10:00", "15:00", 1);
}
if (e.getDay() == 5) {
proxy.scheduleObj.setWorkHours([e], "09:00", "15:00", 1);
}
});
}
Please try the above sample and let us know if you need any further assistance.
Regards,
Nevitha