Show More
@@ -40,6 +40,34 b' function highlightCode(node) {' | |||
|
40 | 40 | }); |
|
41 | 41 | } |
|
42 | 42 | |
|
43 | /** | |
|
44 | * Translate timestamps to local ones | |
|
45 | */ | |
|
46 | function translate_time() { | |
|
47 | var els = $('time'); | |
|
48 | if (!els.length) { | |
|
49 | return; | |
|
50 | } | |
|
51 | ||
|
52 | var locale = window.navigator.language; | |
|
53 | var formatter = new Intl.DateTimeFormat( | |
|
54 | locale, | |
|
55 | { | |
|
56 | weekday: 'short', year: 'numeric', month: 'short', day: 'numeric', | |
|
57 | hour: 'numeric', minute: '2-digit', second: '2-digit' | |
|
58 | } | |
|
59 | ); | |
|
60 | ||
|
61 | els.each(function() { | |
|
62 | var el = $(this); | |
|
63 | var dateAttr = el.attr('datetime'); | |
|
64 | if (dateAttr) { | |
|
65 | var date = new Date(dateAttr); | |
|
66 | el.text(formatter.format(date)); | |
|
67 | } | |
|
68 | }); | |
|
69 | } | |
|
70 | ||
|
43 | 71 | $( document ).ready(function() { |
|
44 | 72 | hideEmailFromForm(); |
|
45 | 73 | |
@@ -53,4 +81,6 b' function highlightCode(node) {' | |||
|
53 | 81 | addRefLinkPreview(); |
|
54 | 82 | |
|
55 | 83 | highlightCode($(document)); |
|
84 | ||
|
85 | translate_time(); | |
|
56 | 86 | }); |
@@ -106,6 +106,8 b' function getThreadDiff() {' | |||
|
106 | 106 | |
|
107 | 107 | // TODO Process removed posts if any |
|
108 | 108 | $('.metapanel').attr('data-last-update', data.last_update); |
|
109 | ||
|
110 | translate_time(); | |
|
109 | 111 | }) |
|
110 | 112 | } |
|
111 | 113 | |
@@ -140,7 +142,7 b' function updatePost(postHtml) {' | |||
|
140 | 142 | showNewPostsTitle(1); |
|
141 | 143 | |
|
142 | 144 | lastUpdate = post.children('.post-info').first() |
|
143 |
.children('.pub_time').first(). |
|
|
145 | .children('.pub_time').first().html(); | |
|
144 | 146 | |
|
145 | 147 | if (bottom) { |
|
146 | 148 | scrollToBottom(); |
@@ -195,7 +197,7 b' function updateMetadataPanel(lastUpdate)' | |||
|
195 | 197 | |
|
196 | 198 | if (lastUpdate !== '') { |
|
197 | 199 | var lastUpdateField = $('#last-update'); |
|
198 |
lastUpdateField. |
|
|
200 | lastUpdateField.html(lastUpdate); | |
|
199 | 201 | blink(lastUpdateField); |
|
200 | 202 | } |
|
201 | 203 |
@@ -18,7 +18,7 b'' | |||
|
18 | 18 | onclick="javascript:addQuickReply('{{ post.id }}'); return false;" |
|
19 | 19 | title="{% trans 'Quote' %}" {% endif %}>({{ post.get_absolute_id }})</a> |
|
20 | 20 | <span class="title">{{ post.title }}</span> |
|
21 | <span class="pub_time">{{ post.pub_time|date:'r' }}</span> | |
|
21 | <span class="pub_time"><time datetime="{{ post.pub_time|date:'c' }}">{{ post.pub_time|date:'r' }}</time></span> | |
|
22 | 22 | {% comment %} |
|
23 | 23 | Thread death time needs to be shown only if the thread is alredy archived |
|
24 | 24 | and this is an opening post (thread death time) or a post for popup |
@@ -85,7 +85,7 b'' | |||
|
85 | 85 | <button id="autoupdate">{% trans 'Update' %}</button> |
|
86 | 86 | <span id="reply-count">{{ thread.get_reply_count }}</span>/{{ max_replies }} {% trans 'messages' %}, |
|
87 | 87 | <span id="image-count">{{ thread.get_images_count }}</span> {% trans 'images' %}. |
|
88 | {% trans 'Last update: ' %}<span id="last-update">{{ thread.last_edit_time|date:'r' }}</span> | |
|
88 | {% trans 'Last update: ' %}<span id="last-update"><time datetime="{{ thread.last_edit_time|date:'c' }}">{{ thread.last_edit_time|date:'r' }}</time></span> | |
|
89 | 89 | [<a href="rss/">RSS</a>] |
|
90 | 90 | {% endcache %} |
|
91 | 91 | </span> |
@@ -58,7 +58,7 b'' | |||
|
58 | 58 | <span id="reply-count">{{ thread.get_reply_count }}</span>/{{ max_replies }} |
|
59 | 59 | {% trans 'messages' %}, |
|
60 | 60 | <span id="image-count">{{ thread.get_images_count }}</span> {% trans 'images' %}. |
|
61 | {% trans 'Last update: ' %}{{ thread.last_edit_time|date:'r' }} | |
|
61 | {% trans 'Last update: ' %}<time datetime="{{ thread.last_edit_time|date:'c' }}">{{ thread.last_edit_time|date:'r' }}</time> | |
|
62 | 62 | [<a href="rss/">RSS</a>] |
|
63 | 63 | {% endcache %} |
|
64 | 64 | </span> |
General Comments 0
You need to be logged in to leave comments.
Login now