useDateFormatter

Provides a memoised Intl.DateTimeFormat instance for date formatting.

Provides a memoised Intl.DateTimeFormat instance for locale-aware date formatting. It caches formatter instances for performance and automatically respects the specified locale.

Import#

import { useDateFormatter } from '@volue/wave-react';

Example#


API reference#

Arguments#

Prop
Type
Default
locale
string
—
options
Intl.DateTimeFormatOptions
—

Returns#

Intl.DateTimeFormat — A memoised formatter instance.