next fix for timedelate error
This commit is contained in:
parent
6adf6ab955
commit
4a832714d9
@ -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
|
||||
|
||||
|
||||
@ -90,7 +90,7 @@
|
||||
{% if config %}
|
||||
<script>
|
||||
// Config + globale Sounds nur setzen, wenn vorhanden
|
||||
window.mkConfig = {{ config | tojson | safe | timedelta }};
|
||||
window.mkConfig = {{ config | tojson | safe }};
|
||||
window.mkGlobalSounds = {{ global_sounds | tojson | safe }};
|
||||
|
||||
console.log("base.html → mkConfig gesetzt:", window.mkConfig);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user