angular / angular/components

Update NativeDateAdapter to use the new i18n api

未关闭
#8,100 4 条评论 8 个 reaction 已指派 0 人 在 GitHub 查看
area: material/datepicker i18n P2
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
91

描述

#### Bug, feature request, or proposal:
Feature Request

#### What is the expected behavior?
Material should no longer use the intl API with Angular v5.

#### What is the current behavior?
Material's NativeDateAdapter uses the intl API

#### What are the steps to reproduce?
Providing a StackBlitz/Plunker (or similar) is the *best* way to get the team to see your issue.

Plunker starter (using on `@master`): https://goo.gl/DlHd6U

StackBlitz starter (using latest `npm` release): https://goo.gl/wwnhMV

#### What is the use-case or motivation for changing an existing behavior?
In Angular v5 we have removed the dependency on the intl API to use CLDR data instead. We've also added a new I18n API that can be used by libraries for such a case.
It's very easy to rewrite the NativeDateAdapter to use this instead of intl. The only problem is that Material requires a few formats that are not yet supported by the API.
We can write an adapter that does partial matching, but it'd be better to wait for https://github.com/angular/angular/issues/19823 to be resolved first.

贡献指南

打开贡献指南

调研方向

首先定位 NativeDateAdapter 的实现,并检查它当前如何使用 intl API。将所需的日期格式与 Angular v5 的新 I18n API 进行比较,并检查对 Angular issue 19823 的依赖;完成的标准是 NativeDateAdapter 不再使用 intl,同时支持所需的格式。

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

评估

技术栈
angular, typescript
领域
internationalization
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

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