This site describes solve-engine 2.44.0, the version npm installs.
createTemporalCalendar
function createTemporalCalendar(temporal, options?): TemporalCalendar;Defined in: packages/engine/src/temporal/TemporalCalendar.ts:495
A calendar backend over the host’s Temporal, for the engine’s calendar
option.
import { createEngine } from "solve-engine";import { createTemporalCalendar } from "solve-engine/temporal";
const calendar = createTemporalCalendar(globalThis.Temporal, { timeZone: "Asia/Tokyo" });const engine = createEngine({ calendar });Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
temporal | TemporalLike | The Temporal implementation: globalThis.Temporal where the runtime ships one, or a polyfill’s export. |
options? | TemporalCalendarOptions | The zone to compute in and, for a test, the clock to read; see TemporalCalendarOptions. |
Returns
Section titled “Returns”A backend that computes every date in that zone and answers what the Date backend would in it.
Throws
Section titled “Throws”TEMPORAL_IMPLEMENTATION_INVALID when temporal lacks the members the backend uses, and
TEMPORAL_TIME_ZONE_UNKNOWN when the implementation does not know the zone asked for.