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
feat(b-calendar, b-form-datepicker): allow customization of in-component displayed date format (closes#4797) (#4835)
* feat(b-calendar): made date format to be configurable
* Added new prop `formatLong` that defaults to current layout
* Allows for better control on display (e.g. in combination with layouts defined in other components like vue-i18n)
* feat(b-form-datepicker): Added format option for display of formatted date string
* docs(b-calendar): Updated prop list
* docs(b-form-datepicker): Updated prop list
* Fixed prop default value
* fix(b-form-datepicker): prop default value
* docs(b-calendar): change prop name and referenced default format
* docs(b-form-datepicker): change prop name and referenced default format
* fix(b-calendar): rename prop and enforce gregorian calendar
* fix(b-form-datepicker): rename prop in component and in forwarding to b-calendar
* chore(b-calendar): file formating
* docs(b-calendar): add styling subsection on new prop
* Fixed referenced filename
* docs(b-form-datepicker): add styling subsection on new prop
* Removed fixed calendar type from prop dateFormatOptions
* Removed fixed calendar type from prop dateFormatOptions
* Update package.json
* Update package.json
* Update README.md
* Update README.md
* Update calendar.js
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Update README.md
* Minor tweaks
* Enhance docs
Co-authored-by: Troy Morehouse <troymore@nbnet.nb.ca>
Co-authored-by: Jacob Müller <jacob.mueller.elz@gmail.com>
|`month`|`'numeric'`, `'2-digit'`, `'long'`, `'short'`, or `'narrow'`|
266
+
|`day`|`'numeric'`, or `'2-digit'`|
267
+
|`weekday`|`'long'`, `'short'`, or `'narrow'`|
268
+
269
+
Notes:
270
+
271
+
- Leaving out certain options may affect the formatted text string, e.g. the `weekday`
272
+
- The formatted value will vary according to the resolved locale. Some locales may not support the
273
+
`'narrow'` format and will fall back to `'short'` or `long'` (if `'short'` is not available)
274
+
-`year`, `month` and `day` will always be shown. If you need to leave out a value, set the property
275
+
to `undefined`, although this is highly discouraged for accessibility reasons
276
+
233
277
### Hiding the top selected date header
234
278
235
279
By default, the current selected date will be displayed at the top of the calendar component,
236
280
formatted in the locale's language.
237
281
238
-
You can hide this header via the `hide-header` prop. Note this only visually hides the selected
282
+
You can hide this header via the `hide-header` prop. Note this only _visually hides_ the selected
239
283
date, while keeping it available to screen reader users as an `aria-live` region.
240
284
241
285
### Border and padding
@@ -400,7 +444,7 @@ properties:
400
444
|`selectedFormatted`| The selected date formatted in the current locale. If no date is selected, this will be the value of the `label-no-date-selected` prop |
401
445
|`activeYMD`| The current date of the calendar day button that can receive focus as a string (`YYYY-MM-DD` format) |
402
446
|`activeDate`| The current date of the calendar day button that can receive focus as a `Date` object |
403
-
|`activeFormated`| The active date formatted in the current locale |
447
+
|`activeFormatted`| The active date formatted in the current locale |
404
448
|`disabled`| Will be `true` if active date is disabled, `false` otherwise |
405
449
|`locale`| The resolved locale (may not be the same as the requested locale) |
406
450
|`calendarLocale`| The resolved locale used by the calendar, optionally including the calendar type (i.e. 'gregory'). Usually this will be the same as `locale`, but may include the calendar type used, such as `fa-u-ca-gregory` when selecting the Persian locale (`'fa'`) |
0 commit comments