Skip to content

Commit f627af1

Browse files
author
Austin Green
authored
chore(datepicker): update examples to include correct localization names (#393)
1 parent 6b4bd24 commit f627af1

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

packages/datepickers/README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,3 @@ import { Datepicker } from '@zendeskgarden/react-datepickers';
3636
</Field>
3737
</ThemeProvider>;
3838
```
39-
40-
## date-fns dependency
41-
42-
We currently use the v2, `date-fns@next`, distribution of [date-fns](https://date-fns.org/).
43-
This allows us to provide a wider range of locales and include non-strict date parsing.
44-
Ensure you are depending on locales from this version of `date-fns`.

packages/datepickers/src/Datepicker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export interface IDatepickerProps {
8181
*/
8282
small?: boolean;
8383
/**
84-
* Override default date parsing
84+
* Override default date parsing. Receives a localized input value and returns a `Date` object.
8585
*/
8686
customParseDate?: (inputValue: string) => Date;
8787
/**

packages/datepickers/src/examples/localization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ initialState = {
5757
>
5858
<DropdownField>
5959
<DropdownLabel>Locale</DropdownLabel>
60-
<DropdownHint>Using date-fns localization</DropdownHint>
60+
<DropdownHint>Using Intl.DateTimeFormat localization</DropdownHint>
6161
<Select>{state.locale.label}</Select>
6262
</DropdownField>
6363
<Menu>
@@ -72,7 +72,7 @@ initialState = {
7272
<Col lg={8}>
7373
<Field>
7474
<Label>Localized date</Label>
75-
<Hint>Using date-fns locale</Hint>
75+
<Hint>Using Intl.DateTimeFormat localization</Hint>
7676
<Datepicker
7777
value={state.value}
7878
onChange={newDate => {

0 commit comments

Comments
 (0)