Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Add default format (angularMomentConfig.format config property) #52

Merged
merged 2 commits into from
Jun 1, 2014

Conversation

otang
Copy link
Contributor

@otang otang commented Jun 1, 2014

Added angularMomentConfig.format for a "global" default value to be used for all dates. This can be overridden by setting the am-format attribute.

Use case:
All my dates are in UTC, but I want to show the user relative local time. The current method is to use the am-format property <span am-time-ago="bid.time" am-format="YYYY-MM-DD HH:mm:ss Z"></span>. With many dates this was clutter, so I prefer to define a default format: app.constant('angularMomentConfig', {format: 'YYYY-MM-DD HH:mm:ss Z'}); instead.

otang added 2 commits June 1, 2014 17:51
…es my problem of converting all my UTC/GMT dates into local relative time, without needing a format attr on each element.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling ff5d871 on otang:default-format into d01c8bc on urish:master.

urish added a commit that referenced this pull request Jun 1, 2014
Add default format (angularMomentConfig.format config property)
@urish urish merged commit f53e86f into urish:master Jun 1, 2014
@urish
Copy link
Owner

urish commented Jun 1, 2014

Thanks!

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

Successfully merging this pull request may close these issues.

3 participants