Add 'now' global function to Jinja2 templates
The footer template uses now().year for the copyright date. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit is contained in:
@@ -135,3 +135,6 @@ def register_filters(app: Flask) -> None:
|
||||
app.jinja_env.filters["format_number"] = format_number
|
||||
app.jinja_env.filters["date_format"] = date_format
|
||||
app.jinja_env.filters["truncate_words"] = truncate_words
|
||||
|
||||
# Global functions
|
||||
app.jinja_env.globals["now"] = datetime.utcnow
|
||||
|
||||
Reference in New Issue
Block a user