createInstance

Commons
stable

Instantiates a reactive date adapter from the given IDateOptions and locale instance. The adapter locale is kept in sync with the active locale via a watcher.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

options
required
IDateOptions
Date configuration: adapter class or pre-built adapter, locale map, and custom formats.
locale
required
ILocaleInstance
The active origam locale instance, used to set and reactively update the adapter locale.

API

Return value

The value returned by this util.

A reactive date adapter that automatically switches locale when the app locale changes.

Usage

Examples

Ready-to-paste usage snippets.

Provide a date adapter to the app

typescript