API
@agape/temporal

setTemporal Function

Sets the Temporal implementation to be used by the Agape Temporal namespace.

API

function setTemporal(  temporal: Temporal): void

setTemporal

void

Sets the Temporal implementation to be used by the Agape Temporal namespace.

@paramtemporal:  unknown
The Temporal implementation to use (e.g., from `@js-temporal/polyfill`)
@returnsvoid

Description

Sets the Temporal implementation to be used by the Agape Temporal namespace.

This function allows you to explicitly configure which Temporal implementation should be used. The provided temporal takes precedence over any Temporal found on globalThis.

Usage

import { setTemporal, Temporal } from '@agape/temporal';
import { Temporal as TemporalPolyfill } from '@js-temporal/polyfill';

// Set your preferred polyfill
setTemporal(TemporalPolyfill);

// Now all Temporal namespace usage will use this implementation
const now = Temporal.PlainDateTime.from('2025-09-19T10:00');
console.log(now.toString()); // Uses your polyfill