@xtandard/lib/tanstack/temporal
URL query-state parsers for the six Temporal kinds (peers @js-temporal/polyfill, valibot).
import { … } from "@xtandard/lib/tanstack/temporal";Variables
Section titled “Variables”| Name | Summary |
|---|---|
parseAsDuration |
A length of time — ISO-8601 duration (PT30M, P1DT2H). Equality is by length, not spelling: PT90M equals PT1H30M, and P1D equals PT24H (a day is 24 h, as in Temporal.Duration.compare without relativeTo). Years, months and weeks have no fixed length, so they must match exactly: P1M ≠ P30D, P1Y ≠ P12M, P1W ≠ P7D. |
parseAsInstant |
A precise moment on the global timeline — ISO-8601 UTC (2026-06-18T16:00:00Z). An input with an offset is accepted and normalized to UTC; one without an offset or Z parses to null. |
parseAsPlainDate |
A calendar date, no time, no zone (2026-12-25). An invalid date parses to null. |
parseAsPlainDateTime |
A floating wall date+time, no zone (2026-12-25T09:00:00). |
parseAsPlainTime |
A wall-clock time, no date, no zone (09:00:00). Serializes with seconds. |
parseAsTimeZone |
An IANA timezone id (America/Los_Angeles, UTC), validated via the @xtandard/lib/valibot TimeZone schema. Returned as the branded TimeZone string; an unknown id parses to null. Not a Temporal kind, but it travels with them. |
parseAsZonedDateTime |
A DST-aware wall date/time bound to an IANA zone (2026-06-18T09:00:00-07:00[America/Los_Angeles]). The [zone] annotation is required; without it the value parses to null. |