Angular: Angular2 DatePipe does not support ordinal indicators

Created on 13 Feb 2017  ·  1Comment  ·  Source: angular/angular

I'm submitting a feature request.

[ ] 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

Angular2 DatePipe does not support ordinal indicators (1st, 2nd, 5th etc)

Expected behavior

Ideally there would be a format option for the ordinal indicator proceeding the date number.

eg. {{ myDate| date: 'dO' }} where O would be the ordinal indicator.

Minimal reproduction of the problem with instructions

N/A

What is the motivation / use case for changing the behavior?

I am listing a bunch of a events that have their respective dates displayed. In our design, each date is in the following format "22nd September"

Please tell us about your environment:

MacOS, VSCode, NPM, NodeJS

  • Angular version: 2.2.1
  • Angular Universal version: ~2.1.0-rc.1
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

    Chrome

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    ES6/7

  • Node (for AoT issues): node --version =

i18n feature

Most helpful comment

Is there any update for this request?

>All comments

Is there any update for this request?

Was this page helpful?
0 / 5 - 0 ratings