docs-bug(datepicker): Wrong docs for parsing dates as UTC with luxon
- Lenguaje dominante
- TypeScript
- Estrellas
- 25k
- Forks
- 6.8k
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 91
Descripción
### 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:
>
> ```ts
> bootstrapApplication(MyApp, {
> providers: [provideLuxonDateAdapter(undefined, {useUtc: true})]
> });
> ```
[`provideLuxonDateAdapter()` only takes the 1 parameter](https://github.com/angular/components/blob/46b67d15053ce31b4742b809f1777b32eb2f1863/src/material-luxon-adapter/adapter/index.ts#L32-L34), 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](https://github.com/angular/components/pull/32936) copying the Moment adapter.
The current actual way to achieve it is:
```ts
bootstrapApplication(MyApp, {
providers: [
provideLuxonDateAdapter(),
{
provide: MAT_LUXON_DATE_ADAPTER_OPTIONS,
useValue: {
useUtc: true,
} satisfies Partial,
},
]
});
```
### Affected documentation page
https://material.angular.dev/components/datepicker/overview#choosing-a-date-implementation-and-date-format-settings
Guía de contribución
Línea de trabajo
Abre la página de descripción general del datepicker afectada y compara su ejemplo de LuxonDateAdapter con el código fuente del adaptador enlazado en src/material-luxon-adapter/adapter/index.ts. Revisa el PR existente y actualiza la documentación para que la configuración descrita coincida con la API compatible y la configuración de UTC documentada sea correcta.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- angular, typescript
- Área
- documentation
- Tipo de issue
- Documentación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 25/100