# isOpenAt

Industry: Core

## Signature

```ts
isOpenAt(isoString: string, schedule: OperatingSchedule, optionsArg?: { disambiguation?: "compatible" | "earlier" | "later" | "reject" | undefined; }): boolean
```

Return true when `schedule` is open at the instant `isoString`.

- Open means inside one of the half-open intervals `operatingIntervals` returns: an opening instant is open, a closing instant is closed. Where one window ends as the next begins, the schedule stays open.
- A window belongs to the date it starts on, so a Friday 23:00–06:00 window is open at 01:00 on Saturday even when Saturday is a holiday.
- `isoString` is an instant: an offset (`Z`, `±HH:MM`) is required, and a bracketed zone never supplies the zone — the schedule's own zone reads the windows. Only its instant is read, a minute-rounded offset as the bracketed zone's real one (see `isValidInstant`).
- Returns `false` on invalid input: an invalid instant, an `OperatingSchedule` that `isValidOperatingSchedule` refuses, or a `disambiguation` that is not one of the four values. `isValidOperatingSchedule` tells a closed schedule from an invalid one.
- **Limit at an offset with seconds.** The instant is placed in the offset's whole-minute zone, moved by its seconds, and the moved instant must be inside Temporal's range. So within the offset's seconds (under a minute) of the first instant Temporal supports (`-271821-04-20T00:00:00Z`), for an offset west of UTC, this returns `false`. There `false` is the sentinel, not a reading of the schedule. An offset to the minute has no such limit.

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `isoString` | `string` | ISO 8601 instant string to test |
| `schedule` | `OperatingSchedule` | `{ timeZone, weekly, holidays?, overrides? }` operating schedule |

## Options

**optionsArg**

How a window edge on a clock change is resolved

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `disambiguation?` | `"compatible"` \| `"earlier"` \| `"later"` \| `"reject"` ([`Disambiguation`](/gmt/reference/types/Disambiguation/)) | `"compatible"`, Temporal's default. | How a window edge in a repeated or skipped local hour becomes an instant, as `resolveLocal` resolves it. `"compatible"` takes the earlier instant of a repeated fall-back hour and the later one of a skipped spring-forward hour, and `"earlier"` and `"later"` take that side in both cases. `"reject"` returns `false` when a window with such an edge is the only one that could be open at `isoString`. |

## Returns

true when open at that instant, or false when closed or on invalid input

## Related types

- [`OperatingSchedule`](/gmt/reference/types/OperatingSchedule/)
- [`IsoWeekday`](/gmt/reference/types/IsoWeekday/)
- [`LocalWindow`](/gmt/reference/types/LocalWindow/)
- [`BusinessCalendar`](/gmt/reference/types/BusinessCalendar/)
- [`OperatingOverride`](/gmt/reference/types/OperatingOverride/)
- [`Disambiguation`](/gmt/reference/types/Disambiguation/)

## Examples

```ts
import { isOpenAt } from "@northguild/gmt/calendar/hours";

isOpenAt("2024-06-17T01:00:00Z", { timeZone: "Asia/Tokyo", weekly: { 1: [{ from: "09:00", to: "17:00" }] } }) // true — Monday 10:00 local
```

## Source

[calendar/hours/isOpenAt.ts](https://github.com/northguild/gmt/blob/main/packages/gmt/src/calendar/hours/isOpenAt.ts)
