A lightweight polyfill for Temporal, successor to the JavaScript Date object
Overall
score
96%
Evaluation — 96%
↑ 1.19xAgent success when using this tile
A module that resolves local schedule requests into precise instants across DST changes, with explicit disambiguation and transition queries.
@generates
export type Disambiguation = "earlier" | "later" | "reject";
export interface LocalScheduleRequest {
date: string; // ISO date, e.g., "2021-11-07"
time: string; // 24h local time, e.g., "01:30"
timeZone: string; // IANA zone id
offset?: string; // Optional expected offset like "-04:00"
disambiguation?: Disambiguation;
}
export interface Occurrence {
instant: string; // ISO instant (UTC) string
localDateTime: string; // Local date-time string in the target zone
offset: string; // Offset used for the occurrence
transitionNote?: string; // Present when a DST/offset boundary was crossed
}
export interface TransitionInfo {
at: string; // ISO instant when the next transition occurs
offsetBefore: string; // Offset before the transition
offsetAfter: string; // Offset after the transition
}
export function resolveStart(request: LocalScheduleRequest): Occurrence;
export function buildDailySchedule(
request: LocalScheduleRequest,
throughDate: string
): Occurrence[];
export function nextTransition(
timeZone: string,
afterInstant?: string
): TransitionInfo | null;Provides time-zone aware date-time math with explicit disambiguation and offset transition queries.
Install with Tessl CLI
npx tessl i tessl/npm-temporal-polyfilldocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10