日本語 · English

isOpen / bizOpen / bizClose — the business-hours standard derivations

Translated from the canonical Japanese page reference/isOpen.md. The source_sha above records the source revision; a consistency check flags this page when the Japanese original changes.

Category: standard derivations of a calendar entity (ADR-41) / Signature: isOpen(t) : Bool (value predicate) · bizOpen/bizClose : Stream (derived streams) / all names settled (2026-07-09, the F51 batch confirmation; the supply side was renamed from opens/closes to sessionOpens/sessionCloses and settled = ADR-41 revised). Normative: spec §3.9.1, ADR-41.

Meaning

When the in-scope calendar: entity C has the paired reserved public words sessionOpens and sessionCloses (the opening sequence and the closing sequence = the business-hours supply convention; declared as facts in the civil coordinates = wall clock of the entity’s tz; optional), the language prescribes uniformly:

The derivations are entity-relative — the decision inputs (which days are off; which tz the times are read in) resolve in the entity’s culture and do not depend on the reader’s premise (bizDay = the consumer-relative day axis plays a different role. Whether the TSE is open is a fact decided by the TSE’s culture alone — readable even by a cross-tz reader without tripping the tz check). A session’s business-day-ness is read from its opening day — an overnight session’s (open 22:00, close 03:00 the next day) tail follows its opening day (a Friday-night session is still open in Saturday’s small hours; a Sunday-night session is off in its entirety).

Examples

A single session 9:00–15:00, a half-day holiday (1/6 closes at 11:30), a holiday on 1/1. “Every full hour within business hours” is the single word isOpen (the hand-built band-plus-witness pattern of ../../design/40-examples/06-business-hours.md (Japanese) §6.3 collapses into this one word):

# eval: 2026-01-05..2026-01-08
premise TSE {
  calendar-system: Gregorian
  tz: "Asia/Tokyo"
  source: "example"
  satSunC = everyDay |> filter(d => weekday(d) == Sat or weekday(d) == Sun)
  holidays = [2026-01-01] covering: 2026..2026
  nonWorking = satSunC | holidays
  nine  = chronos grid 1d anchor: 2026-01-01T09:00
  three = chronos grid 1d anchor: 2026-01-01T15:00
  halfDayCloses = [2026-01-06T11:30] covering: 2026..2026
  sessionOpens  = nine |> first
  sessionCloses = (three |> first |> filter(t => not coincides(halfDayCloses, day, t))) | halfDayCloses
}
premise JP2 {
  calendar-system: Gregorian
  calendar: TSE
  tz: "Asia/Tokyo"
  wkst: Mon
  hourly = everyInstant |> strideBy(1h, from: 2026-01-01)
}
@JP2
hourly |> filter(t => isOpen(t))
#=> 2026-01-05T09:00 2026-01-05T10:00 2026-01-05T11:00 2026-01-05T12:00 2026-01-05T13:00 2026-01-05T14:00
#=> 2026-01-06T09:00 2026-01-06T10:00 2026-01-06T11:00
#=> 2026-01-07T09:00 2026-01-07T10:00 2026-01-07T11:00 2026-01-07T12:00 2026-01-07T13:00 2026-01-07T14:00

“Fire at each business day’s open” = bizOpen itself (the canonical form after the ADR-38 revision — 1/1 (holiday) and 1/3–1/4 (Sat–Sun) drop out):

# eval: 2026-01-01..2026-01-08
premise TSE {
  calendar-system: Gregorian
  tz: "Asia/Tokyo"
  source: "example"
  satSunC = everyDay |> filter(d => weekday(d) == Sat or weekday(d) == Sun)
  holidays = [2026-01-01] covering: 2026..2026
  nonWorking = satSunC | holidays
  nine  = chronos grid 1d anchor: 2026-01-01T09:00
  three = chronos grid 1d anchor: 2026-01-01T15:00
  sessionOpens  = nine |> first
  sessionCloses = three |> first
}
premise JP2 { calendar-system: Gregorian; calendar: TSE; tz: "Asia/Tokyo"; wkst: Mon }
@JP2
bizOpen
#=> 2026-01-02T09:00 2026-01-05T09:00 2026-01-06T09:00 2026-01-07T09:00

Pitfalls

nonWorking (the entity; bizDay = the consumer-relative day axis) · coincides (the window-membership predicate — isOpen is a derived form of the same family) · grid (a time-of-day anchor = wall-clock ticks; ADR-31 revision 2) · strideBy · shift (elapsed-time preserving — the wall clock belongs not here but to the declaration side) · spec §3.9.1 · ADR-41 / ADR-31 revision 2 · F67/F79/F85/F89.