Skip to content

docs(material/datepicker): fix incorrect provideLuxonDateAdapter usage for UTC#32975

Open
yogeshwaran-c wants to merge 1 commit intoangular:mainfrom
yogeshwaran-c:docs/datepicker-luxon-utc-options
Open

docs(material/datepicker): fix incorrect provideLuxonDateAdapter usage for UTC#32975
yogeshwaran-c wants to merge 1 commit intoangular:mainfrom
yogeshwaran-c:docs/datepicker-luxon-utc-options

Conversation

@yogeshwaran-c
Copy link
Contributor

What kind of change does this PR introduce?

Documentation fix

What is the current behavior?

The datepicker overview docs show an incorrect code example for configuring
the Luxon date adapter to parse dates as UTC:

providers: [provideLuxonDateAdapter(undefined, {useUtc: true})]

provideLuxonDateAdapter only accepts one parameter (date formats), not a
second options parameter. This pattern was incorrectly copied from
provideMomentDateAdapter which does support a second options parameter.

Closes #32935

What is the new behavior?

The docs now show the correct approach using the
MAT_LUXON_DATE_ADAPTER_OPTIONS injection token:

providers: [
  provideLuxonDateAdapter(),
  {provide: MAT_LUXON_DATE_ADAPTER_OPTIONS, useValue: {useUtc: true}}
]

Additional context

Note: PR #32936 proposes adding the options parameter to
provideLuxonDateAdapter to match the Moment adapter API. If that PR is
merged, the docs can be simplified back. This PR fixes the docs to match
the current API.

…e for UTC

The docs incorrectly showed provideLuxonDateAdapter accepting a second
options parameter for useUtc configuration. Unlike provideMomentDateAdapter,
the Luxon adapter provider function only accepts a formats parameter.
The correct way to configure UTC parsing is by providing the
MAT_LUXON_DATE_ADAPTER_OPTIONS injection token separately.

Fixes angular#32935
@pullapprove pullapprove bot requested review from crisbeto and wagnermaciel March 25, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs-bug(datepicker): Wrong docs for parsing dates as UTC with luxon

1 participant