-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
Setting a default format #48
Conversation
Added how to use default()
Thanks for the contribution. The main issue that I have is that the design of this extension is such that in general the methods of this extension match the JavaScript functions in moment.js. Adding a |
I fully understand that. What about this. In moment.js if you call moment().format() it will yield the current time in ISO 8601 format. If you do the same with flask-moment you get
|
@jacobthetechy yes, supporting |
@miguelgrinberg This is what I have come up with.
To make the change you add I believe its the only way for python, javascript, and jinja to all be happy. I tried to be as close to moment.js but jinja does not like Thoughts? |
@jacobthetechy Thanks! I took parts of your PR and completed this feature. Take a look at the master branch. |
@miguelgrinberg Beautiful! Thanks so much for adding this and allowing me to contribute. |
I found in using this in my app I use the same string format in all my web pages. When adding new dates in new pages I would have a hard time remembering what exactly that format was. This solves that problem by setting a config variable to the format needed without needing to register a new jinja variable.