summaryrefslogtreecommitdiff
path: root/internal/util
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-10-02 15:54:42 +0200
committerLibravatar GitHub <noreply@github.com>2022-10-02 15:54:42 +0200
commitdeba75cad14f47bb42ea55e7d126d3adea7855a6 (patch)
treea83c673900d827bb8cc3bb4a4d60cc37651e91be /internal/util
parentfix emojis not showing in spoiler text (#878) (diff)
downloadgotosocial-deba75cad14f47bb42ea55e7d126d3adea7855a6.tar.xz
[chore] Use shorter timestamps in frontend for replies (#875)
* rename timestampShort -> timestampVague * add ParseISO8601 * start fiddling with timestamp * pad/margin a bit more consistently * remove visibilty icon, change timestamp use * update timestamp logic * check + log errors * properly cut-off long display- and usernames Co-authored-by: f0x <f0x@cthu.lu>
Diffstat (limited to 'internal/util')
-rw-r--r--internal/util/time.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/util/time.go b/internal/util/time.go
index f969908a7..2f7fd6721 100644
--- a/internal/util/time.go
+++ b/internal/util/time.go
@@ -28,3 +28,8 @@ const ISO8601 = "2006-01-02T15:04:05.000Z"
func FormatISO8601(t time.Time) string {
return t.UTC().Format(ISO8601)
}
+
+// ParseISO8601 parses the given time string according to the ISO8601 const.
+func ParseISO8601(in string) (time.Time, error) {
+ return time.Parse(ISO8601, in)
+}