angular / angular/components

Update NativeDateAdapter to use the new i18n api

Open
#8,100 4 comments 8 reactions 0 assignees View on GitHub
area: material/datepicker i18n P2
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

#### 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.

Contributor guide

Open the contributing guide

Research direction

Start by locating the NativeDateAdapter implementation and reviewing how it currently uses the intl API. Compare the required date formats with Angular v5's new I18n API and check the dependency on Angular issue 19823; done means NativeDateAdapter no longer uses intl while supporting the required formats.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
internationalization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.