From d1b176a5fd37e32bab4131af1b9a706dd234f46e Mon Sep 17 00:00:00 2001
From: Fredrik Jonsson <frjo@xdeb.org>
Date: Wed, 18 Aug 2021 19:48:42 +0200
Subject: [PATCH] Use date formats from settings instead of hardcoding them.

---
 .../activity/templates/activity/include/listing_base.html     | 4 ++--
 .../funds/templates/funds/includes/review_sidebar_item.html   | 2 +-
 .../funds/templates/funds/includes/round-block-listing.html   | 2 +-
 hypha/apply/funds/templates/funds/tables/table.html           | 2 +-
 .../templates/application_projects/project_admin_detail.html  | 2 +-
 hypha/apply/review/templates/review/review_detail.html        | 2 +-
 hypha/public/news/templates/news/news_index.html              | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/hypha/apply/activity/templates/activity/include/listing_base.html b/hypha/apply/activity/templates/activity/include/listing_base.html
index 8727ac0c7..197b82514 100644
--- a/hypha/apply/activity/templates/activity/include/listing_base.html
+++ b/hypha/apply/activity/templates/activity/include/listing_base.html
@@ -6,7 +6,7 @@
     <div class="feed__content js-feed-content">
         <div class="feed__meta js-feed-meta">
             <p class="feed__label feed__label--{{ activity.type }} feed__label--mobile">{{ activity.type|capfirst }}</p>
-            <p class="feed__meta-item"><span>{{ activity|display_author:request.user }}</span> – {{ activity.timestamp|date:"Y-m-d H:i" }}</p>
+            <p class="feed__meta-item"><span>{{ activity|display_author:request.user }}</span> – {{ activity.timestamp|date:"SHORT_DATETIME_FORMAT" }}</p>
 
             {% if editable %}
                 {% if activity.user == request.user %}
@@ -18,7 +18,7 @@
                     </p>
                 {% endif %}
                 <p class="feed__meta-item feed__meta-item--last-edited" {% if not activity.edited %} hidden {% endif %}>
-                    (Last edited: <span class="js-last-edited">{{ activity.edited|date:"Y-m-d H:i" }}</span>)
+                    (Last edited: <span class="js-last-edited">{{ activity.edited|date:"SHORT_DATETIME_FORMAT" }}</span>)
                 </p>
             {% endif %}
 
diff --git a/hypha/apply/funds/templates/funds/includes/review_sidebar_item.html b/hypha/apply/funds/templates/funds/includes/review_sidebar_item.html
index 4040de06b..1c9cb1107 100644
--- a/hypha/apply/funds/templates/funds/includes/review_sidebar_item.html
+++ b/hypha/apply/funds/templates/funds/includes/review_sidebar_item.html
@@ -17,7 +17,7 @@
                         {% if reviewer.role %}{% image reviewer.role.icon max-12x12 %}{% endif %}
                     </div>
                 </a>
-                <div class="reviews-sidebar__date">{{ reviewer.review.created_at|date:"Y-m-d" }}</div>
+                <div class="reviews-sidebar__date">{{ reviewer.review.created_at|date:"SHORT_DATE_FORMAT" }}</div>
             </div>
         {% else %}
             <div class="reviews-sidebar__name">
diff --git a/hypha/apply/funds/templates/funds/includes/round-block-listing.html b/hypha/apply/funds/templates/funds/includes/round-block-listing.html
index 6136b584d..e6da43697 100644
--- a/hypha/apply/funds/templates/funds/includes/round-block-listing.html
+++ b/hypha/apply/funds/templates/funds/includes/round-block-listing.html
@@ -8,7 +8,7 @@
                 <p> {{ round.fund|default_if_none:"-" }} </p>
                 <p class="round-block__date">
                     {% if round.end_date %}
-                        {{ display_text }} {{ round.end_date|date:"Y-m-d" }}
+                        {{ display_text }} {{ round.end_date|date:"SHORT_DATE_FORMAT" }}
                     {% else %}
                         Open
                     {% endif %}
diff --git a/hypha/apply/funds/templates/funds/tables/table.html b/hypha/apply/funds/templates/funds/tables/table.html
index c9d6eed8b..0c71cd594 100644
--- a/hypha/apply/funds/templates/funds/tables/table.html
+++ b/hypha/apply/funds/templates/funds/tables/table.html
@@ -28,7 +28,7 @@
                         <td>
                             {% if submission.last_update %}
                                 <strong>by {{ submission.last_user_update }}</strong><br/>
-                                {{ submission.last_update|date:"Y-m-d \a\t H:i" }}
+                                {{ submission.last_update|date:"SHORT_DATETIME_FORMAT" }}
                             {% else %}
                                 &mdash;
                             {% endif %}
diff --git a/hypha/apply/projects/templates/application_projects/project_admin_detail.html b/hypha/apply/projects/templates/application_projects/project_admin_detail.html
index f7ef7817b..356bb906d 100644
--- a/hypha/apply/projects/templates/application_projects/project_admin_detail.html
+++ b/hypha/apply/projects/templates/application_projects/project_admin_detail.html
@@ -112,7 +112,7 @@
     <h5>Approved By:</h5>
 
     {% for approval in approvals %}
-    <p>{{ approval.by }} - {{ approval.created_at|date:"Y-m-d" }}</p>
+    <p>{{ approval.by }} - {{ approval.created_at|date:"SHORT_DATE_FORMAT" }}</p>
     {% endfor %}
 </div>
 {% endblock %}
diff --git a/hypha/apply/review/templates/review/review_detail.html b/hypha/apply/review/templates/review/review_detail.html
index 970005efc..a2e710806 100644
--- a/hypha/apply/review/templates/review/review_detail.html
+++ b/hypha/apply/review/templates/review/review_detail.html
@@ -5,7 +5,7 @@
 <div class="admin-bar">
     <div class="admin-bar__inner">
         <h1 class="beta heading heading--no-margin heading--bold">Review</h1>
-        <h5>For <a href="{% url "funds:submissions:detail" review.submission.id %}">{{ review.submission.title }}</a> by {{ review.author }} at {{ review.created_at|date:"Y-m-d" }} {% if review.is_updated %}<small>(Last updated: {{ review.updated_at|date:"Y-m-d" }})</small>{% endif %}</h5>
+        <h5>For <a href="{% url "funds:submissions:detail" review.submission.id %}">{{ review.submission.title }}</a> by {{ review.author }} at {{ review.created_at|date:"SHORT_DATE_FORMAT" }} {% if review.is_updated %}<small>(Last updated: {{ review.updated_at|date:"SHORT_DATE_FORMAT" }})</small>{% endif %}</h5>
 
         {% include 'review/includes/review_opinions_list.html' with opinions=review.opinions.all %}
     </div>
diff --git a/hypha/public/news/templates/news/news_index.html b/hypha/public/news/templates/news/news_index.html
index 84c5c7ef6..1e23535d9 100644
--- a/hypha/public/news/templates/news/news_index.html
+++ b/hypha/public/news/templates/news/news_index.html
@@ -36,7 +36,7 @@
                             <h6 class="listing__teaser">{{ n.listing_summary|default:n.introduction }}</h6>
                         {% endif %}
                         <span class="listing__meta">
-                            {{ n.display_date|date:"Y-m-d" }}
+                            {{ n.display_date|date:"SHORT_DATE_FORMAT" }}
                             {% if n.authors.all %}
                                 | By:
                                 {% for author in n.authors.all %}
-- 
GitLab