diff --git a/app/__init__.py b/app/__init__.py index 018d56f..6c9924c 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -23,8 +23,10 @@ def create_app(): from datetime import timedelta - def timedelta_filter(td): - return str(td) # oder td.total_seconds() als Zahl + def timedelta_filter(value): + if isinstance(value, timedelta): + return value.total_seconds() # oder str(value) + return value app.jinja_env.filters['timedelta'] = timedelta_filter diff --git a/templates/base.html b/templates/base.html index 7960d40..d1dd14b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -90,7 +90,7 @@ {% if config %}