Skip to content

Commit b39c4c9

Browse files
nl6720jelly
authored andcommitted
Use ISO 8601 date format
Explicitly specify the ISO 8601 format `Y-m-d H:i` in the date template. Django 5.0.5 removed the USE_L10N setting making the locale-specific formats override DATE_FORMAT and DATETIME_FORMAT. See https://forum.djangoproject.com/t/datetime-format/30811/10 for details. Fixes #520
1 parent 3da96a4 commit b39c4c9

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

Diff for: settings.py

-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
DATE_FORMAT = 'Y-m-d'
4242
DATETIME_FORMAT = 'Y-m-d H:i'
4343

44-
# Disable so our own DATE_FORMAT/DATETIME_FORMAT is used.
45-
USE_L10N = False
46-
4744
# Login URL configuration
4845
LOGIN_URL = '/login/'
4946
LOGIN_REDIRECT_URL = '/'

Diff for: templates/devel/admin_log.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<tbody>
3131
{% for entry in admin_log %}
3232
<tr>
33-
<th scope="row">{{ entry.action_time|date:"DATETIME_FORMAT" }}</th>
33+
<th scope="row">{{ entry.action_time|date:"Y-m-d H:i" }}</th>
3434
{% if log_user %}
3535
<td>{{ entry.user.username }}{% if entry.user.get_full_name %} ({{ entry.user.get_full_name }}){% endif %}</td>
3636
{% else %}

Diff for: templates/packages/package_details.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -182,19 +182,19 @@ <h4>Versions Elsewhere</h4>
182182
{% else %}{{ pkg.packager_str }}{% endif %}{% endwith %}</td>
183183
</tr><tr>
184184
<th>Build Date:</th>
185-
<td>{{ pkg.build_date|date:"DATETIME_FORMAT" }} UTC</td>
185+
<td>{{ pkg.build_date|date:"Y-m-d H:i" }} UTC</td>
186186
</tr>{% if pkg.signature %}<tr>
187187
<th>Signed By:</th>
188188
<td>{% with signer=pkg.signer %}{% if signer %}{% pgp_key_link pkg.signature.key_id signer.get_full_name|safe %}{% else %}Unknown ({% pgp_key_link pkg.signature.key_id|safe %}){% endif %}{% endwith %}</td>
189189
</tr><tr>
190190
<th>Signature Date:</th>
191-
<td>{{ pkg.signature.creation_time|date:"DATETIME_FORMAT" }} UTC</td>
191+
<td>{{ pkg.signature.creation_time|date:"Y-m-d H:i" }} UTC</td>
192192
</tr>{% else %}<tr>
193193
<th>Signed By:</th>
194194
<td>Unsigned</td>
195195
</tr>{% endif %}<tr>
196196
<th>Last Updated:</th>
197-
<td>{{ pkg.last_update|date:"DATETIME_FORMAT" }} UTC{% if pkg.is_recent %} <span class="recent" title="Your mirror may not yet have this package version">({{ pkg.last_update|naturaltime }})</span>{% endif %}</td>
197+
<td>{{ pkg.last_update|date:"Y-m-d H:i" }} UTC{% if pkg.is_recent %} <span class="recent" title="Your mirror may not yet have this package version">({{ pkg.last_update|naturaltime }})</span>{% endif %}</td>
198198
</tr>
199199
{% if user.is_authenticated %}<tr>
200200
<th>Reproducible Status:</th>

Diff for: templates/releng/release_detail.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ <h3>Torrent Information</h3>
3838

3939
<ul>
4040
<li><strong>Comment:</strong> {{ torrent.comment }}</li>
41-
<li><strong>Creation Date:</strong> {{ torrent.creation_date|date:"DATETIME_FORMAT" }} UTC</li>
41+
<li><strong>Creation Date:</strong> {{ torrent.creation_date|date:"Y-m-d H:i" }} UTC</li>
4242
<li><strong>Created By:</strong> {{ torrent.created_by }}</li>
4343
<li><strong>Announce URL:</strong> {{ torrent.announce }}</li>
4444
<li><strong>File Name:</strong> {{ torrent.file_name }}</li>

0 commit comments

Comments
 (0)