Skip to content

addZonedBusinessDays

addZonedBusinessDays(value: string, amount: number): string
import { addZonedBusinessDays } from "@northguild/gmt/zoned/calculate";

Return a zoned ISO 8601 datetime string with amount business days added to value.

  • Uses fixed ISO Monday–Friday business days (no locale awareness).
  • Saturday and Sunday are skipped during the count.
  • Preserves the original time component through the operation.
  • Returns “” on invalid input.
Parameter Type Description
value string ISO 8601 zoned datetime string
amount number number of business days to add

Zoned ISO 8601 datetime string after adding business days, or “” on invalid input

addZonedBusinessDays("2024-03-15T14:30:00-04:00[America/New_York]", 1) // "2024-03-18T14:30:00-04:00[America/New_York]"
addZonedBusinessDays("2024-03-16T14:30:00-04:00[America/New_York]", 1) // "2024-03-18T14:30:00-04:00[America/New_York]"
addZonedBusinessDays("2024-03-15T14:30:00-04:00[America/New_York]", 0) // "2024-03-15T14:30:00-04:00[America/New_York]"
addZonedBusinessDays("invalid", 1) // ""

zoned/calculate/addZonedBusinessDays.ts