By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 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