question 208 Dates Numbers & Regex · medium
The next business day
Refunds are paid on the next business day after they're approved: not a Saturday or Sunday, and not a public holiday.
Function
next_business_day(day_text, holidays)day_text
YYYY-MM-DD, the approval dateholidaysa list of
YYYY-MM-DD textsReturnsthe first date after
day_text that is Monday–Friday and not a holiday, as YYYY-MM-DDExamples
callnext_business_day('2024-12-20', [])returns'2024-12-23'
callnext_business_day('2024-12-24', ['2024-12-25'])returns'2024-12-26'
callnext_business_day('2024-12-31', ['2025-01-01'])returns'2025-01-02'