all repos — honk @ ee48e9f9d25ab4a32da354a47bebaee9dfb3da40

my fork of honk

set date on load
Anirudh Oppiliappan x@icyphox.sh
Tue, 08 Nov 2022 20:33:44 +0530
commit

ee48e9f9d25ab4a32da354a47bebaee9dfb3da40

parent

7652dd8d7768324b4ea00759109bb5f9a94bd3b6

2 files changed, 6 insertions(+), 4 deletions(-)

jump to
M views/honk.htmlviews/honk.html

@@ -27,7 +27,7 @@ <a class="honkerlink" href="/h?xid={{ .Honker }}" data-xid="{{ .Honker }}">{{ .Username }}</a>

{{ else }} <a href="{{ .Honker }}" rel=noreferrer>{{ .Username }}</a> {{ end }} -<span class="clip"><a href="{{ .URL }}" rel=noreferrer>{{ .What }}</a> <span style="float: right;" id="honkdate">{{ .Date.Local.Format "02 Jan 2006 15:04 MST" }}</span> </span> +<span class="clip"><a href="{{ .URL }}" rel=noreferrer>{{ .What }}</a> <span onload="setDate()" style="float: right;" id="honkdate">{{ .Date.Local.Format "02 Jan 2006 15:04 MST" }}</span> </span> {{ if .Oonker }} <br> <span class="left1em clip">
M views/local.jsviews/local.js

@@ -18,6 +18,8 @@ return day + " " + month + year;

} } -var honkdate = document.getElementById("honkdate").textContent; -const ts = Date.parse(honkdate); -honkdate.textContent = timeSince(ts); +function setDate() { + var honkdate = document.getElementById("honkdate").textContent; + const ts = Date.parse(honkdate); + honkdate.textContent = timeSince(ts); +}