webapp: 12-hour times (e.g. 2026-10-05 1:54 PM EDT)

CSV exports keep ISO 8601 24-hour timestamps.
This commit is contained in:
cproudlock
2026-10-05 14:16:58 -04:00
parent 83ba4865e8
commit e43ab2a652

View File

@@ -1513,11 +1513,11 @@ def to_display_tz(value):
@app.template_filter("local_dt")
def local_dt(value, seconds=False):
"""Any timestamp shown in the UI, as e.g. '2026-10-05 13:54 EDT'."""
"""Any timestamp shown in the UI, 12-hour, as e.g. '2026-10-05 1:54 PM EDT'."""
dt = to_display_tz(value)
if dt is None:
return value or "-"
return dt.strftime("%Y-%m-%d %H:%M:%S %Z" if seconds else "%Y-%m-%d %H:%M %Z")
return dt.strftime("%Y-%m-%d %-I:%M:%S %p %Z" if seconds else "%Y-%m-%d %-I:%M %p %Z")
@app.template_filter("timestamp_fmt")