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

Babel time related formatting functions in templates needs documentation #4

Closed
jokull opened this issue Nov 2, 2010 · 0 comments
Closed
Milestone

Comments

@jokull
Copy link

jokull commented Nov 2, 2010

I would like to see these functions automatically added to the app context. Perhaps jinja2 should do this as the babel extension adds gettext to the context.

from flaskext.babel import format_datetime, format_date, format_timedelta
@app.context_processor
def inject_babel_formatting():
    return dict(format_datetime=format_datetime,
        format_date=format_date, format_timedelta=format_timedelta)

EDIT: Just noticed that these are exposed as filters already. Needs documentation.

@TkTech TkTech added this to the v2.0.0 milestone Feb 25, 2020
@TkTech TkTech closed this as completed in e967b35 Aug 27, 2020
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

2 participants