-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
feat(datePipe): support narrow forms for month and weekdays #12297
Conversation
@@ -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} = {}; |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
len === 2
75c0d2b
to
9e0fad7
Compare
9e0fad7
to
f302a40
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
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")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information:
Closes #12294