Skip to content
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

Changing Date Format #2

Open
fayazv opened this issue Apr 21, 2015 · 4 comments
Open

Changing Date Format #2

fayazv opened this issue Apr 21, 2015 · 4 comments
Assignees

Comments

@fayazv
Copy link
Contributor

fayazv commented Apr 21, 2015

Currently the date format is:

Fri, 20 Mar 2015 16:03:24 GMT

I want it to look like below in the front-end:

20/03/2015

I have tried the following:

<td>{{ trader.issue_date | date:"dd/MM/yyyy"}}</td>
<td ng-bind="trader.issue_date | date:'dd/MM/yyyy'"></td>

The result is the same.
How do I change the date format?

@fayazv fayazv assigned kynan and dgorissen and unassigned kynan Apr 21, 2015
@kynan
Copy link
Member

kynan commented Apr 22, 2015

Is your issue_date really a JavaScript Date object?

@fayazv
Copy link
Contributor Author

fayazv commented Apr 23, 2015

I'm using _created instead of issue_date and the format it's stored in mongo is similar to date_recorded in TaarifaWaterpoints

@fayazv
Copy link
Contributor Author

fayazv commented Apr 27, 2015

@kynan, @dgorissen any suggestions on this?

@dgorissen
Copy link
Member

I would double check you fullfill the requirements:

Date to format either as Date object, milliseconds (string or number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is specified in the string input, the time is considered to be in the local timezone.

https://docs.angularjs.org/api/ng/filter/date

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

No branches or pull requests

3 participants