Private
Public Access
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c339d456e4 |
No files matched your search
@@ -559,6 +559,7 @@ form p {
|
||||
font-size: 0.8rem;
|
||||
color: var(--text-dim);
|
||||
flex: 0 0 auto;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.article-actions {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// instant plus a UTC-formatted fallback as their initial text, and this
|
||||
// reformats them using the browser's own timezone, client-side, so the
|
||||
// server never needs to know (or guess) where the viewer actually is.
|
||||
var SHORT_OPTIONS = { hour: "numeric", minute: "2-digit" };
|
||||
var SHORT_OPTIONS = { month: "short", day: "numeric", hour: "numeric", minute: "2-digit" };
|
||||
var LONG_OPTIONS = {
|
||||
year: "numeric",
|
||||
month: "short",
|
||||
@@ -21,6 +21,10 @@
|
||||
var date = new Date(iso);
|
||||
if (isNaN(date.getTime())) return;
|
||||
var options = el.dataset.localFormat === "short" ? SHORT_OPTIONS : LONG_OPTIONS;
|
||||
if (options === SHORT_OPTIONS && date.getFullYear() !== new Date().getFullYear()) {
|
||||
// Date-only rows from a previous year would otherwise be ambiguous.
|
||||
options = Object.assign({ year: "numeric" }, SHORT_OPTIONS);
|
||||
}
|
||||
try {
|
||||
el.textContent = date.toLocaleString(undefined, options);
|
||||
} catch (e) {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<a href="{% url 'reader:article_detail' article.pk %}{% if scope_qs %}?{{ scope_qs }}{% endif %}" class="article-title"
|
||||
data-inline-url="{% url 'reader:article_inline' article.pk %}">{{ article.title|default:"(untitled)" }}</a>
|
||||
{% if article.published_at %}
|
||||
<time class="article-time" datetime="{{ article.published_at|date:"c" }}" data-local-format="short">{{ article.published_at|date:"g:i A" }}</time>
|
||||
<time class="article-time" datetime="{{ article.published_at|date:"c" }}" data-local-format="short">{{ article.published_at|date:"M j, g:i A" }}</time>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div id="article-body-{{ article.pk }}" class="article-inline-body" hidden></div>
|
||||
|
||||
Reference in new issue
Block a user