Skip to content

Commit ca052d4

Browse files
authored
docs: clarify date picker i18n usage (#2073)
1 parent eae0d9d commit ca052d4

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

packages/vaadin-date-picker/src/vaadin-date-picker-mixin.d.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,15 @@ interface DatePickerMixin {
7575
/**
7676
* The object used to localize this component.
7777
* To change the default localization, replace the entire
78-
* _i18n_ object or just the property you want to modify.
78+
* `i18n` object with a custom one.
79+
*
80+
* To update individual properties, extend the existing i18n object like so:
81+
* ```
82+
* datePicker.i18n = { ...datePicker.i18n, {
83+
* formatDate: date => { ... },
84+
* parseDate: value => { ... },
85+
* }};
86+
* ```
7987
*
8088
* The object has the following JSON structure and default values:
8189
*

packages/vaadin-date-picker/src/vaadin-date-picker-mixin.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,15 @@ export const DatePickerMixin = (subclass) =>
129129
/**
130130
* The object used to localize this component.
131131
* To change the default localization, replace the entire
132-
* _i18n_ object or just the property you want to modify.
132+
* `i18n` object with a custom one.
133+
*
134+
* To update individual properties, extend the existing i18n object like so:
135+
* ```
136+
* datePicker.i18n = { ...datePicker.i18n, {
137+
* formatDate: date => { ... },
138+
* parseDate: value => { ... },
139+
* }};
140+
* ```
133141
*
134142
* The object has the following JSON structure and default values:
135143
*

0 commit comments

Comments
 (0)