diff --git a/app/template_filters.py b/app/template_filters.py index 6f31ea05..93b72038 100644 --- a/app/template_filters.py +++ b/app/template_filters.py @@ -2,6 +2,7 @@ from . import app from .models import Permission, Package, PackageState, PackageRelease from .utils import abs_url_for, url_set_query from flask_user import current_user +from flask_babel import format_timedelta from urllib.parse import urlparse @app.context_processor @@ -37,3 +38,7 @@ def date(value): @app.template_filter() def datetime(value): return value.strftime("%Y-%m-%d %H:%M") + " UTC" + +@app.template_filter() +def timedelta(value): + return format_timedelta(value) diff --git a/app/templates/todo/list.html b/app/templates/todo/list.html index 0b1b4cec..5c545e98 100644 --- a/app/templates/todo/list.html +++ b/app/templates/todo/list.html @@ -47,6 +47,12 @@