Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#32,935 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
25/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
停滞
技术栈
angular, typescript
领域
documentation

调研方向

打开受影响的 datepicker 概览页面,并将其中的 LuxonDateAdapter 示例与链接到的适配器源代码 src/material-luxon-adapter/adapter/index.ts 进行比较。查看现有的 PR,并更新文档,使所描述的配置与受支持的 API 相匹配,并确保文档中记录的 UTC 设置准确无误。

由索引模型根据 Issue 内容生成。

描述

area: material/datepicker docs P3
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

主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 1 小时
30 天内合并 PR
84

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

angular/components 的其他 Issue

查看 angular/components 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。