Method Deck / dates

Add business days to a date

Adds (or subtracts) a count of Monday-to-Friday business days to a date, treating Saturday and Sunday as non-business days and excluding NO holidays.

Published for review. The Founder is checking every card himself; anything he strikes comes down the same hour.

Try it

Inputs

Outputs

Steps

  1. Parse the date as a proleptic Gregorian civil date and convert it to a day-number (Hinnant days_from_civil, cited above).
  2. Business-day convention used here: Monday through Friday are business days; Saturday and Sunday are not. This method does NOT exclude any holidays, only weekends.
  3. Step the day-number one day at a time in the sign of business_days (forward for positive, backward for negative).
  4. Each step, determine the ISO 8601 weekday (Monday=1 .. Sunday=7) from the day-number modulo 7; if it is not Saturday (6) or Sunday (7), count it against the remaining business-day total.
  5. Stop once the requested number of business days has been counted and convert the final day-number back to a civil date.

Constants

None.

Sources

Worked example and test vectors

NameInputsAnswer
worked example{"date":"2026-10-01","business_days":5}2026-10-08
test vector: starting on a Saturday{"date":"2026-10-03","business_days":1}2026-10-05
test vector: subtracting across a weekend{"date":"2026-10-06","business_days":-3}2026-10-01

Published card