Documentation Feedback
The docs include this extract:
By default the LuxonDateAdapter creates dates in your time zone specific locale. You can change the default behaviour to parse dates as UTC by passing useUtc: true into provideLuxonDateAdapter:
bootstrapApplication(MyApp, {
providers: [provideLuxonDateAdapter(undefined, {useUtc: true})]
});
provideLuxonDateAdapter() only takes the 1 parameter, no second options with useUtc.
My guess is this is a holdover from Moment, which does have this option.
It would be nice, and fairly easy, to actually have this same option.
edit: I went ahead and made a PR copying the Moment adapter.
The current actual way to achieve it is:
bootstrapApplication(MyApp, {
providers: [
provideLuxonDateAdapter(),
{
provide: MAT_LUXON_DATE_ADAPTER_OPTIONS,
useValue: {
useUtc: true,
} satisfies Partial<MatLuxonDateAdapterOptions>,
},
]
});
Affected documentation page
https://material.angular.dev/components/datepicker/overview#choosing-a-date-implementation-and-date-format-settings