Member-only story
paid time off (PTO) — 6.0
handle half days
During a demo, I was asked about handling half-days off, which I hadn’t initially considered. Employees in my region (Europe) can take full or half days of PTO. My first thought was to manually adjust the PTO count if half days were used, but this would disrupt my ‘next working day’ calculations and future plans to integrate with Google Calendar. I need a date-specific solution to accurately track PTO, including half days.
The solution I devised consists of two interconnected parts. Firstly, a table is required to present employees with various options.
Secondly, a logic system is necessary to assign these values (0.5 or 1) to specific dates, as illustrated below.
Crucial to this logic is the utilization of the first and last working days within a given period, which are then correlated with the selected option.
The logic for the last day can be derived by replacing First()
with Last()
in the existing logic for the first day.