jinjaUtils.py
Python script, ASCII text executable
1from app import app 2from datetime import datetime 3 4 5@app.template_filter("split") 6def split(value: str, separator=" ", maxsplit: int = -1): 7return value.split(separator, maxsplit) 8 9 10@app.template_filter("strftime") 11def strftime(value: datetime, syntax: str): 12return value.strftime(syntax) 13 14 15@app.template_filter("unixtime") 16def strftime(value: datetime): 17return round(value.timestamp()) 18