Skip to content

Commit c2d24ca

Browse files
committed
docs(material/datepicker): add note about locale data in date-fns
Adds a note about how locale data should be provided for users that consume the `date-fns` adapter. Fixes #24026.
1 parent 0202e7b commit c2d24ca

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/material/datepicker/datepicker.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,10 @@ from `@angular/core`. If you want to override it, you can provide a new value fo
290290
export class MyApp {}
291291
```
292292

293+
**Note:** if you're using the `MatDateFnsModule`, you have to provide the data object for your
294+
locale to `MAT_DATE_LOCALE`, instead of the locale code. Locale data for `date-fns` can be imported
295+
from `date-fns/locale`.
296+
293297
It's also possible to set the locale at runtime using the `setLocale` method of the `DateAdapter`.
294298

295299
<!-- example(datepicker-locale) -->

0 commit comments

Comments
 (0)