Skip to content

Holiday calendars

Shoals has no holiday-calendar module of its own. A business calendar is a Std.Datetime.Business.BusinessCalendar, and the market calendars come from the Shoreleave package. A Shoals function that needs a calendar, such as the Business252 day count, a business-day tenor, a spot lag, or an adjusted schedule, takes a BusinessCalendar argument; pass the Shoreleave calendar whose market and observance rules match the transaction.

Chelis does not re-export an imported name, so import the calendar from its Shoreleave module directly:

import Std.Datetime.Business (Following, business_day_roll)
import Shoreleave.UsFederal (us_federal)
rolled = business_day_roll(us_federal(), date(2025i64, 7i64, 4i64), Following)
// Monday 2025-07-07: 4 July is a US federal holiday
MarketShoreleave calendarModulePublished horizon
US federal government holidays and closuresus_federal()Shoreleave.UsFederal2021-2030
New York Stock Exchangenyse()Shoreleave.Nyse2026-2028
US bond marketsifma()Shoreleave.Sifma2026-2027
Londonengland_and_wales()Shoreleave.EnglandAndWales2019-2028
Tokyojapan_bank()Shoreleave.JapanBank1990-2027
Sydneynew_south_wales()Shoreleave.NewSouthWales2026-2027
Hong Konghong_kong()Shoreleave.HongKong2025-2027
Euro settlementtarget()Shoreleave.Target2026-2028

Each calendar keeps its source's holiday data, weekmask, and finite horizon. A business-day query outside the horizon fails with a domain error, and the try_ form in Std.Datetime.Business returns None; no calendar answers for a year its data does not cover. Each module also has <name>_projected(until_year), which extends the published dates with the calendar's rules through until_year, and try_<name>_projected.

The calendars name their own markets. Japan Bank includes bank-only closures such as 2 January. New South Wales public holidays do not include an August bank holiday. Hong Kong has a Monday-to-Saturday business week. There is no Frankfurt exchange calendar: TARGET is the euro settlement calendar and stays open on German public holidays such as 3 October.

Shoreleave 0.1.0 has no Federal Reserve or USD settlement calendar. us_federal() is the federal government's calendar: the legal holidays plus executive-order closures of federal agencies, such as 24 and 26 December 2025, when the Federal Reserve Banks and Fedwire stayed open. sifma() and nyse() are not substitutes either; both close on Good Friday, for example.