Hi,
From my HR system backend, I'm fetching employees shifts and turning that into calenders with isWorking: true intervals. That's working fine. But they can make availability exceptions, like a meeting or holiday. That's registered not as non-working hours, but as "new" amount of available hours. So, I need to modify a specific interval to change the available hours (startDate/endDate).
E.g. an employee normally has 8 working hours on 27-05 from 8am to 4pm, fetched from his assigned shift. He has a meeting in the morning of 2 hours that day (the exception), so has new available hours as 6. I tried:
resCalendar.addInterval({
startDate : exceptionsData[e].startDate, // being 27-05-2022 10:00
endDate : exceptionsData[e].endDate, // being 27-05-2022 16:00
isWorking : true
});
But that's not doing anything to the existing interval.
Of course, I could also add an isWorking: false interval, which works, but then I need to fetch the interval (working hours) of that specific day to calculate the "unavailability".
How can I achieve this, either change an existing working interval or get a specific one to be able to create a non-working interval?
Thank you.