Skip to content

Clarify module import documentation for datepicker #17418

@Danebrouwer97

Description

@Danebrouwer97

Bug, feature request, or proposal:

When following the guidelines on how to import and use Angular Material's Datepicker, it suggests importing only the MatDatepickerModule.
(source: https://material.angular.io/components/datepicker/api)

However, if only that step is done the Datepicker does not work. The date picker actually requires importing MatDatepickerModule and MatNativeDateModule as well as adding the MatDatepickerModule to the module providers.
(source: https://stackoverflow.com/questions/49720908/angular-material-matdatepicker-no-provider-found-for-dateadapter)

Further down the page contains the heading:
" Choosing a date implementation and date format settings. "
However there is no mention for the need to import it further up the page as a basic setup requirement, nor is the import shown in the examples.

What is the expected behavior?

For the Datepicker to function following the import of the MatDatepickerModule.

What is the current behavior?

The Datepicker does not function,

What are the steps to reproduce?

  • import only the MatDatepickerModule
  • use the Datepicker as suggested

What is the use-case or motivation for changing an existing behavior?

Clearer documentation will prevent further potential bug-reports and/or documentation-reports such as this one.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular Material: 8.1.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: material/datepickerdocsThis issue is related to documentationfeatureLabel used to distinguish feature request from other issueshelp wantedLabel noting an issue which the team is looking for contribution from the community to fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions