docs-bug(datepicker): Wrong docs for parsing dates as UTC with luxon
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 25/100
- Issue 类型
- 文档
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- angular, typescript
调研方向
打开受影响的 datepicker 概览页面,并将其中的 LuxonDateAdapter 示例与链接到的适配器源代码 src/material-luxon-adapter/adapter/index.ts 进行比较。查看现有的 PR,并更新文档,使所描述的配置与受支持的 API 相匹配,并确保文档中记录的 UTC 设置准确无误。
由索引模型根据 Issue 内容生成。
描述
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
- 主要语言
- TypeScript
- 星标
- 25k
- 派生
- 6.8k
- 平均合并
- 1 天 1 小时
- 30 天内合并 PR
- 84
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
angular/components 的其他 Issue
-
area: material/tree docs gemini-triaged needs triage
难度 2/5 1-3 小时 新手友好度 68/100
angular/components#33832 ·
-
area: material/datepicker gemini-triaged P4
难度 2/5 1-3 小时 新手友好度 72/100
angular/components#33763 · 2 条评论 · 3 个 reaction ·
-
area: material/table gemini-triaged P4
难度 1/5 1 小时以内 新手友好度 88/100
angular/components#33709 · 1 条评论 ·
-
area: material/table docs gemini-triaged P4
难度 2/5 1-3 小时 新手友好度 72/100
angular/components#33455 ·
-
area: material/core gemini-triaged P3
难度 1/5 1 小时以内 新手友好度 78/100
angular/components#33059 · 2 条评论 ·
查看 angular/components 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 84/100
bcgov/bc-wallet-mobile#4761 · 1 条评论 ·
-
external-issue to-triage
难度 2/5 1-3 小时 新手友好度 88/100
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100
-
难度 2/5 1-3 小时 新手友好度 82/100
-
refactor
难度 2/5 1-3 小时 新手友好度 84/100