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

Merged
merged 1 commit into from Oct 19, 2016

Conversation

Projects
None yet
5 participants
@laskoviymishka
Contributor

laskoviymishka commented Oct 14, 2016

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

@googlebot googlebot added the cla: yes label Oct 14, 2016

modules/@angular/facade/src/intl.ts
@@ -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} = {};

This comment has been minimized.

@DzmitryShylovich

DzmitryShylovich Oct 14, 2016

Contributor

const

modules/@angular/facade/src/intl.ts
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) {

This comment has been minimized.

@DzmitryShylovich

DzmitryShylovich Oct 14, 2016

Contributor

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

@DzmitryShylovich

DzmitryShylovich Oct 14, 2016

Contributor

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

modules/@angular/facade/src/intl.ts
@@ -165,9 +166,19 @@ function digitCondition(prop: string, len: number): Intl.DateTimeFormatOptions {
result[prop] = len == 2 ? '2-digit' : 'numeric';

This comment has been minimized.

@DzmitryShylovich

DzmitryShylovich Oct 14, 2016

Contributor

len === 2

@DzmitryShylovich

DzmitryShylovich Oct 14, 2016

Contributor

len === 2

@alxhub alxhub merged commit f77ab6a into angular:master Oct 19, 2016

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
cla/google All necessary CLAs are signed
continuous-integration/travis-ci/pr The Travis CI build passed
Details

btrigueiro added a commit to btrigueiro/angular that referenced this pull request Oct 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment