Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Date filter am/pm case #8763

Closed
amichair opened this issue Aug 25, 2014 · 7 comments
Closed

Date filter am/pm case #8763

amichair opened this issue Aug 25, 2014 · 7 comments

Comments

@amichair
Copy link

The current documentation for the date filter is inconsistent about the case of the 'a' AM/PM format - the output is uppercase, but the docs mostly show lowercase, which is misleading. Other than fixing the docs, it would be great to actually support the two different formatting options, e.g. 'a' for uppercase and 'A' for lowercase (the inverse would be more intuitive, but 'a' is already used for uppercase, so for backward compatibility's sake... or just use a different letter for lowercase).

@btford btford added this to the Backlog milestone Aug 25, 2014
@btford
Copy link
Contributor

btford commented Aug 25, 2014

Would you like to submit a PR for this? :D

SekibOmazic added a commit to SekibOmazic/angular.js that referenced this issue Aug 26, 2014
Use uppercase for AM/PM in date filter

fixes angular#8763
@lgalfaso
Copy link
Contributor

@btford This information is picked from the CLDR that

  • Already defines the format using 'a' for the AMPMS symbol
  • Does not have a lower case version of AMPMS

I am not sure what are the document issues, keeping this issue open to get more information on this last part

@amichair
Copy link
Author

The documentation issues are the ones fixed in #8780 above, i.e. that all examples show lowercase am/pm whereas the actual format is uppercase.

@lgalfaso
Copy link
Contributor

@amichair thanks, landed as 7a36d49

lgalfaso pushed a commit that referenced this issue Aug 29, 2014
Use uppercase for AM/PM in date filter

fixes #8763
@amichair
Copy link
Author

Thanks @SekibOmazic for actually doing it :-)

@markogresak
Copy link

You can use lowercase filter after date to convert am/pm to lowercase.

For example: 1288323623006 | date: "h:mma" | lowercase will produce "5:40am"

Although I agree with you that a/A notations would be much better.

@andriy101
Copy link

It is also possible to inject and modify $locale service: $locale.DATETIME_FORMATS.AMPMS = ['am', 'pm'];
See plunker: https://plnkr.co/edit/a49kjvOdifXPAvBlmXEi?p=preview

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants