79498120

Date: 2025-03-10 13:26:20
Score: 1
Natty:
Report link

The solution you currently have would assume the day's half is at 12:00.

With that assumption in mind you could also take the diff in hours and apply modulo 24 over them (120%24 -> 12).

If the value resulted is exactly 12 than you can consider it half day, but by using this you will only allow splitting the day in to halves.

I'd recommend using a different mechanism for the hours off.

Calculate the full days + compute the working hours that you want to take off afterwards.

Reasons:
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: Gabi Dj