-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Feature Request: Date pipe - Support narrow form for weekdays in #12294
Description
I'm submitting a ... (check one with "x")
[ ] bug report => search github for a similar issue or PR before submitting
[X] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
Current behavior
With the current implementation of the date pipe, It's not possible to render weekdays in narrow form (M, T, W, T, F, S, S).
Expected behavior
It would be useful to be able to render weekdays in narrow form.
What is the motivation / use case for changing the behavior?
Date pickers often use the narrow format to display the days of the week. At the moment if you want to achieve this, you need to create an Intl.DateTimeFormatter in your component, and pass the weekdays as a string. It'd be more ideal to use actual dates and the date pipe in the template. Since it's supported by the JS INTL API, I imagine that it should be a trivial change. As for the format string, I feel that 'EE' should be appropriate here.
Please tell us about your environment:
macOS Sierra, NPM 3.10.3
- Angular version: 2.0.1
- Browser: all
- Language: all
- Node (for AoT issues):
node --version= v6.3.0