From 81bf0181e27042364af46280445c50e82de742ce Mon Sep 17 00:00:00 2001 From: dandds Date: Tue, 11 Sep 2018 09:45:15 -0400 Subject: [PATCH] use filter for ccpo approval log timestamp --- atst/filters.py | 4 ++-- templates/requests/approval.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/atst/filters.py b/atst/filters.py index 47ac3afc..b0ceda9c 100644 --- a/atst/filters.py +++ b/atst/filters.py @@ -65,9 +65,9 @@ def renderList(value): return app.jinja_env.filters["safe"]("
".join(value)) -def formattedDate(value): +def formattedDate(value, formatter="%m/%d/%Y"): if value: - return value.strftime("%m/%d/%Y") + return value.strftime(formatter) else: return "-" diff --git a/templates/requests/approval.html b/templates/requests/approval.html index fbef27e8..f65222d9 100644 --- a/templates/requests/approval.html +++ b/templates/requests/approval.html @@ -171,7 +171,7 @@ {% endif %} - {% set timestamp=status.time_created.strftime("%Y-%m-%d %H:%M:%S %Z") %} + {% set timestamp=status.time_created | formattedDate("%Y-%m-%d %H:%M:%S %Z") %}