In this episode, we're tackling how to handle employee schedule exclusions—think holidays, partial days off, or even recurring lunch breaks. We pick up where we left off, now working with a full weekly schedule for an employee. The idea here is to introduce exclusions that can remove time blocks from their available schedule.
We start off by manually adding an exclusion (like a day off for the employee) directly in the database—choosing the date and time range. Next, we check in the app to see how this exclusion affects the schedule display. The episode demonstrates how to list and edit these periods, making it easier to visualize all the active work blocks, and then iterates through those to apply any exclusions by subtracting their times from the schedule.
You'll see how we use a method to subtract these exclusion periods, whether that's for a full day, a half day, or even more complex cases (like being off on one day and coming in late the next). We work through a few examples, tweaking times and days to experiment with the outcome. There are also a few debugging moments—like realizing weekends were excluded from our schedule—but we fix this on the fly for better testing.
By the end, you’ll understand how to easily subtract any excluded times from your main available periods, making your schedule logic way more adaptable for real-world use cases like holidays or time-off. The takeaway: subtracting exclusions from schedules is super straightforward, and you now have the tools to let employees set precise working and non-working times.