add timestamp macro

This commit is contained in:
2025-06-30 17:11:24 +03:00
parent a95200caf9
commit 19bf98f5b5
5 changed files with 16 additions and 5 deletions

View File

@ -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