A lightweight polyfill for Temporal, successor to the JavaScript Date object
Overall
score
96%
Evaluation — 96%
↑ 1.19xAgent success when using this tile
Implement a tiny module that initializes the package's bridge for legacy Date objects and uses that bridge to convert and compare moments. Use the dependency's built-in conversion from Date to its native instant type rather than recreating the transformation yourself.
Date instances. @testDate, converts it via the bridge and returns an ISO-8601 string for the same moment. @testDate constructed in a local offset (e.g., 2021-03-15T10:00:00-05:00), conversion yields an ISO-8601 string reflecting the exact instant (no timezone shifts beyond the original timestamp). @testDate inputs, computes the absolute difference in milliseconds using bridged instants instead of native Date arithmetic. @test@generates
export function installBridge(): void;
export function toInstantString(date: Date): string;
export function gapInMilliseconds(a: Date, b: Date): number;Provides a modern time API with a built-in bridge from legacy Date objects to high-precision time values.
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