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

Configurable default moment format #49

Closed
Kilowhisky opened this issue May 20, 2015 · 5 comments
Closed

Configurable default moment format #49

Kilowhisky opened this issue May 20, 2015 · 5 comments

Comments

@Kilowhisky
Copy link

Right now moment format is hard coded to: LLLL. I've love the ability to globally set the default format to something else besides having to pass it into every moment function.

If at all possible it would be great to tie it to the locale enhancement so formats could changed based on language selected. (issue #14)

@stefanpenner
Copy link
Collaborator

any ideas on where this config should live? We could scoope it up from config/environment

@Kilowhisky
Copy link
Author

That sounds like a great place!

@jasonmit
Copy link
Collaborator

jasonmit commented Aug 7, 2015

Working on this tonight

@stefanpenner
Copy link
Collaborator

@jasonmit <3

@jasonmit
Copy link
Collaborator

jasonmit commented Aug 7, 2015

If at all possible it would be great to tie it to the locale enhancement so formats could changed based on language selected. (issue #14)

I'm not sure this is needed since locale data implements what LLLL is on a per-locale basis.

For example, fr locale dictates to render L as DD/MM/YYYY and under en L is MM/DD/YYYY

If you wanted to deviate from the canned date formats: (ie: LT, LTS, L, LL, LLL, LLLL) you are able to implement your own custom locale data. Moment already supports this. But I think the more popular thing would be to use these canned formats since it's probably the behavior you are after.

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