Skip to content

feat(datePipe): support narrow forms for month and weekdays #12297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 19, 2016

Conversation

laskoviymishka
Copy link
Contributor

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x")

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior? (You can also link to an open issue here)

Narrow form not supported

What is the new behavior?

Narrow form is supported

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[x] No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

Closes #12294

@@ -165,9 +166,19 @@ function digitCondition(prop: string, len: number): Intl.DateTimeFormatOptions {
result[prop] = len == 2 ? '2-digit' : 'numeric';
return result;
}

function nameCondition(prop: string, len: number): Intl.DateTimeFormatOptions {
var result: {[k: string]: string} = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const

function nameCondition(prop: string, len: number): Intl.DateTimeFormatOptions {
var result: {[k: string]: string} = {};
result[prop] = len < 4 ? 'short' : 'long';
if (len < 4) {
if (len > 1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

result[prop] = len > 1 ? 'short' : 'narrow';

@@ -165,9 +166,19 @@ function digitCondition(prop: string, len: number): Intl.DateTimeFormatOptions {
result[prop] = len == 2 ? '2-digit' : 'numeric';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

len === 2

@laskoviymishka laskoviymishka force-pushed the feat/date_pipe_narrow_week branch 2 times, most recently from 75c0d2b to 9e0fad7 Compare October 14, 2016 10:00
@laskoviymishka laskoviymishka force-pushed the feat/date_pipe_narrow_week branch from 9e0fad7 to f302a40 Compare October 14, 2016 10:14
@vicb vicb added pr_state: LGTM action: merge The PR is ready for merge by the caretaker area: i18n Issues related to localization and internationalization labels Oct 15, 2016
@alxhub alxhub merged commit f77ab6a into angular:master Oct 19, 2016
btrigueiro pushed a commit to btrigueiro/angular that referenced this pull request Oct 21, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: i18n Issues related to localization and internationalization cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Date pipe - Support narrow form for weekdays in
5 participants