add timestamp macro
This commit is contained in:
@ -7,6 +7,7 @@ from .constants import (
|
||||
PermissionLevel,
|
||||
InfoboxKind, InfoboxIcons, InfoboxHTMLClass
|
||||
)
|
||||
from datetime import datetime
|
||||
import os
|
||||
import time
|
||||
import secrets
|
||||
@ -92,4 +93,8 @@ def create_app():
|
||||
def inject_auth():
|
||||
return {"is_logged_in": is_logged_in, "get_active_user": get_active_user, "active_user": get_active_user()}
|
||||
|
||||
@app.template_filter("ts_datetime")
|
||||
def ts_datetime(ts, format):
|
||||
return datetime.utcfromtimestamp(ts).strftime(format)
|
||||
|
||||
return app
|
||||
|
Reference in New Issue
Block a user