diff libervia/web/pages/_browser/template.py @ 1529:de7e468e2d44

browser (template): fix use of `auto*` in `date_fmt`
author Goffi <goffi@goffi.org>
date Thu, 08 Jun 2023 23:32:46 +0200
parents eb00d593801d
children 285c49d7aad3
line wrap: on
line diff
--- a/libervia/web/pages/_browser/template.py	Thu Jun 08 23:32:45 2023 +0200
+++ b/libervia/web/pages/_browser/template.py	Thu Jun 08 23:32:46 2023 +0200
@@ -40,7 +40,7 @@
 
 
 gidx = Indexer()
-# suffix use to avoid collision with IDs generated in static page
+# suffix used to avoid collision with IDs generated in static page
 SCRIPT_SUFF = "__script__"
 
 def escape_html(txt):
@@ -163,7 +163,7 @@
         limit = moment().startOf('day').subtract(auto_limit, 'days')
         m_fmt = auto_old_fmt if date < limit else auto_new_fmt
 
-    if fmt == "short":
+    elif fmt == "short":
         m_fmt = "DD/MM/YY" if date_only else "DD/MM/YY HH:mm"
     elif fmt == "medium":
         m_fmt = "ll" if date_only else "lll"