Important information: Google announced that, from September 2026, Android devices will require ALL apps to be signed by Google, effectively leading to an iOS situation. Value your right to a computer that does what you want; do not tolerate this monopolistic practice! Contact me if you don't understand why it is bad. Click to learn more.

 jinjaUtils.py

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