You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/@react-aria/datepicker/docs/useDateField.mdx
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ input via the `aria-describedby` attribute.
74
74
75
75
Note that most of this anatomy is shared with [useTimeField](useTimeField.html), so you can reuse many components between them if you have both.
76
76
77
-
State is managed by the <TypeLinklinks={statelyDocs.links}type={statelyDocs.exports.useDatePickerFieldState} /> hook from `@react-stately/datepicker`.
77
+
State is managed by the <TypeLinklinks={statelyDocs.links}type={statelyDocs.exports.useDateFieldState} /> hook from `@react-stately/datepicker`.
78
78
The state object should be passed as an option to `useDateField` and `useDateSegment`.
79
79
80
80
If the date field does not have a visible label, an `aria-label` or `aria-labelledby` prop must be passed instead to
@@ -86,19 +86,19 @@ Dates and times are represented in many different ways by cultures around the wo
86
86
87
87
<TypeLinklinks={docs.links}type={docs.exports.useDateField} /> uses the [@internationalized/date](../internationalized/date/) library to represent dates and times. This package provides a library of objects and functions to perform date and time related manipulation, queries, and conversions that work across locales and calendars. Date and time objects can be converted to and from native JavaScript `Date` objects or [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) strings. See the [documentation](../internationalized/date/), or the [examples below](#value) for more details.
88
88
89
-
<TypeLinklinks={statelyDocs.links}type={statelyDocs.exports.useDatePickerFieldState} /> requires a `createCalendar` function to be provided, which is used to implement date manipulation across multiple calendar systems. The default implementation in `@internationalized/date` includes all supported calendar systems. While this library is quite small (8 kB minified + Brotli), you can reduce its bundle size further by providing your own implementation that includes only your supported calendars. See [below](#reducing-bundle-size) for an example.
89
+
<TypeLinklinks={statelyDocs.links}type={statelyDocs.exports.useDateFieldState} /> requires a `createCalendar` function to be provided, which is used to implement date manipulation across multiple calendar systems. The default implementation in `@internationalized/date` includes all supported calendar systems. While this library is quite small (8 kB minified + Brotli), you can reduce its bundle size further by providing your own implementation that includes only your supported calendars. See [below](#reducing-bundle-size) for an example.
@@ -388,14 +388,14 @@ By default, `useDateField` displays times in either 12 or 24 hour hour format de
388
388
389
389
### Reducing bundle size
390
390
391
-
In the example above, the <TypeLinklinks={i18nDocs.links}type={i18nDocs.exports.createCalendar} /> function from the [@internationalized/date](../internationalized/date/) package is passed to the <TypeLinklinks={statelyDocs.links}type={statelyDocs.exports.useDatePickerFieldState} /> hook. This function receives a [calendar identifier](../internationalized/date/Calendar.html#calendar-identifiers) string, and provides <TypeLinklinks={i18nDocs.links}type={i18nDocs.exports.Calendar} /> instances to React Stately, which are used to implement date manipulation.
391
+
In the example above, the <TypeLinklinks={i18nDocs.links}type={i18nDocs.exports.createCalendar} /> function from the [@internationalized/date](../internationalized/date/) package is passed to the <TypeLinklinks={statelyDocs.links}type={statelyDocs.exports.useDateFieldState} /> hook. This function receives a [calendar identifier](../internationalized/date/Calendar.html#calendar-identifiers) string, and provides <TypeLinklinks={i18nDocs.links}type={i18nDocs.exports.Calendar} /> instances to React Stately, which are used to implement date manipulation.
392
392
393
393
By default, this includes [all calendar systems](../internationalized/date/Calendar.html#implementations) supported by `@internationalized/date`. However, if your application supports a more limited set of regions, or you know you will only be picking dates in a certain calendar system, you can reduce your bundle size by providing your own implementation of `createCalendar` that includes a subset of these `Calendar` implementations.
394
394
395
395
For example, if your application only supports Gregorian dates, you could implement a `createCalendar` function like this:
0 commit comments