Skip to main content

Interface: ZonedTime

Defined in: time/zoned-time.ts:28

Zone-aware date math with the dataset's own zone already bound — no caller passes it, and no caller can pass the wrong one. A plugin cannot import time/ directly (the exports map seals it), so this is the one way a plugin author reaches zone-correct day arithmetic.

Call: dataset.time.eachDay(span).filter((day) => dataset.time.dayOfWeek(day) >= 6).

Properties​

zone​

readonly zone: string

Defined in: time/zoned-time.ts:29

Methods​

addDays()​

addDays(at, days): Instant

Defined in: time/zoned-time.ts:32

Parameters​

at​

Instant

days​

number

Returns​

Instant


dayOfWeek()​

dayOfWeek(at): number

Defined in: time/zoned-time.ts:35

1 = Monday … 7 = Sunday (ISO).

Parameters​

at​

Instant

Returns​

number


diffDays()​

diffDays(a, b): number

Defined in: time/zoned-time.ts:33

Parameters​

a​

Instant

b​

Instant

Returns​

number


each()​

each(span, unit): readonly Instant[]

Defined in: time/zoned-time.ts:45

Each unit boundary in [span.start, span.end), ascending — eachDay's walk, generalised to every unit time/ supports (#404).

Parameters​

span​

TimeSpan

unit​

TimeUnit

Returns​

readonly Instant[]


eachDay()​

eachDay(span): readonly Instant[]

Defined in: time/zoned-time.ts:37

Each day boundary in [span.start, span.end), ascending.

Parameters​

span​

TimeSpan

Returns​

readonly Instant[]


fromPlain()​

fromPlain(plain): Instant

Defined in: time/zoned-time.ts:39

Parameters​

plain​

PlainParts

Returns​

Instant


startOf()​

startOf(at, unit): Instant

Defined in: time/zoned-time.ts:31

Parameters​

at​

Instant

unit​

TimeUnit

Returns​

Instant


startOfDay()​

startOfDay(at): Instant

Defined in: time/zoned-time.ts:30

Parameters​

at​

Instant

Returns​

Instant


step()​

step(at, unit, increment?): Instant

Defined in: time/zoned-time.ts:42

at, stepped by increment (default 1) whole units — e.g. step(at, 'hour') for the next hour boundary's worth of time, step(at, 'hour', -1) for the previous.

Parameters​

at​

Instant

unit​

TimeUnit

increment?​

number

Returns​

Instant


toEndInstant()​

toEndInstant(input): Instant

Defined in: time/zoned-time.ts:51

The Instant a consumer-written end input names, read in this zone — time/toEndInstant on the facade, for the same reason as toInstant.

Parameters​

input​

InstantInput

Returns​

Instant


toInstant()​

toInstant(input): Instant

Defined in: time/zoned-time.ts:48

The Instant a consumer-written input names, read in this zone (#404) — time/toInstant on the one facade a plugin author already holds, so a builder never re-derives date reading.

Parameters​

input​

InstantInput

Returns​

Instant


toPlain()​

toPlain(at): PlainParts

Defined in: time/zoned-time.ts:38

Parameters​

at​

Instant

Returns​

PlainParts