API
@agape/temporal

hasTemporal Function

Checks if Temporal is available in the current environment.

API

function hasTemporal(): boolean

hasTemporal

boolean

Checks if Temporal is available in the current environment.

@returnsboolean

Description

Checks if Temporal is available in the current environment.

This function checks for Temporal implementations in the following priority order:

  1. Agape-level temporal (set via setTemporal())
  2. GlobalThis temporal (native or polyfill)

Usage

import { hasTemporal, Temporal } from '@agape/temporal';

if (hasTemporal()) {
  const now = Temporal.PlainDateTime.from('2025-09-19T10:00');
  console.log(now.toString());
} else {
  console.warn('Temporal not available, falling back to Date');
}