useDate API
Date manipulation with a plain JavaScript Date default. Pass V0DateAdapter for Temporal. Locale-aware formatting through an adapter.
Related
Explore these related pages for additional context and usage patterns.
| Page | Category |
|---|---|
| useDate | Plugins |
| useLocale | Plugins |
| createPlugin | Foundation |
| createCalendar | Forms |
Functions
createDate
(options?: DateOptions<Z>) => EcreateDateContext
(_options?: DateContextOptions<Z>) => ContextTrinity<E>Creates a new date context trinity.
createDatePlugin
(_options?: DatePluginOptions<Z>) => ObjectPluginuseDate
(namespace?: string) => EReturns the current date context.
Inside a component with no plugin, returns a V0PlainDateAdapter context.
Outside a component, throws. A plugin you installed is used as-is.
Options
adapter
DateAdapter<Z> | undefinedDate adapter instance. Omit it to use V0PlainDateAdapter.
Pass V0DateAdapter for Temporal. An adapter you pass is not replaced.
locales
Record<string, string> | undefinedShort locale codes mapped to full Intl locale strings (e.g., { en: 'en-US' })
firstDayOfWeek
number | undefinedFirst day of week override. 0=Sun, 1=Mon, ... 6=Sat. Derived from locale if not set.