Calendar math becomes product behavior

Support tickets, logistics tasks, legal reviews, and customer-success queues often need deadlines that pause outside business hours. A naive add-hours calculation can create due dates on weekends, holidays, or closed hours.

  • Require a timezone for every business-hour calculation.
  • Choose a holiday calendar before adding time.
  • Decide whether the clock should start immediately or at the next business opening.
  • Return item IDs in batch results so failed rows are easy to trace.

Test the ugly cases first

The best confidence comes from cases that cross Friday afternoon, a weekend, and a Monday holiday. If those pass, normal weekday requests are less likely to hide a bug.

  • Start a three-hour SLA late on the Thursday before a Friday holiday.
  • Add one business day from a Friday and confirm the due date lands Monday or later.
  • Compare UTC timestamps with local business time.
  • Check that failed rows do not block successful batch items.

Centralize the rule before every tool copies it

An SLA calculation API gives support systems, internal dashboards, and agents one consistent deadline answer instead of five slightly different calendar implementations.