undo
Anirudh Oppiliappan x@icyphox.sh
Tue, 08 Nov 2022 21:02:57 +0530
2 files changed,
1 insertions(+),
26 deletions(-)
M
views/honk.html
→
views/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 onload="setDate()" 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 style="float: right;" id="honkdate">{{ .Date.Local.Format "02 Jan 2006 15:04 MST" }}</span> </span> {{ if .Oonker }} <br> <span class="left1em clip">
D
views/local.js
@@ -1,25 +0,0 @@
-function timeSince(timeStamp) { - var now = new Date(), - secondsPast = (now.getTime() - timeStamp) / 1000; - if (secondsPast < 60) { - return parseInt(secondsPast) + 's'; - } - if (secondsPast < 3600) { - return parseInt(secondsPast / 60) + 'm'; - } - if (secondsPast <= 86400) { - return parseInt(secondsPast / 3600) + 'h'; - } - if (secondsPast > 86400) { - day = timeStamp.getDate(); - month = timeStamp.toDateString().match(/ [a-zA-Z]*/)[0].replace(" ", ""); - year = timeStamp.getFullYear() == now.getFullYear() ? "" : " " + timeStamp.getFullYear(); - return day + " " + month + year; - } -} - -function setDate() { - var honkdate = document.getElementById("honkdate").textContent; - const ts = Date.parse(honkdate); - honkdate.textContent = timeSince(ts); -}