all repos — honk @ 06a8a6889bf1d49c7789b50bcc2f8e8d53386aba

my fork of honk

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

06a8a6889bf1d49c7789b50bcc2f8e8d53386aba

parent

112c01ed9ce5d18fe5dc84ca652c7146a39ee55b

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 style="margin-left: 1em;" class="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); +}