diff options
author | KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> | 2021-08-18 17:34:12 -0300 |
---|---|---|
committer | KushBlazingJudah <59340248+KushBlazingJudah@users.noreply.github.com> | 2021-08-18 17:34:12 -0300 |
commit | 727b5701327a7e1c5f826f496b8e99c2004e471a (patch) | |
tree | ba7db03ffa5abf5fb893303c7f8f36339f7998e2 /main.go | |
parent | d2cb70e8725371a72c0f9db36ad734041f4fb977 (diff) |
experimental type change for times: string to time.Time
idk what i was doing before this but i wanted to use time.Time to get
something similar to how 4chan's timestamps work, it would've also
been easier for scripts to interface with it, since we have data we
can work with much easier than a string
i am not sure what this means for federation yet, so i'll test it out
before i do anything.
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1640,8 +1640,8 @@ func CreateObject(objType string) ObjectBase { var nObj ObjectBase nObj.Type = objType - nObj.Published = time.Now().UTC().Format(time.RFC3339) - nObj.Updated = time.Now().UTC().Format(time.RFC3339) + nObj.Published = time.Now().UTC() + nObj.Updated = time.Now().UTC() return nObj } @@ -1780,7 +1780,7 @@ func CreateAttachmentObject(file multipart.File, header *multipart.FileHeader) ( image.Href = Domain + "/" + tempFile.Name() image.MediaType = contentType image.Size = size - image.Published = time.Now().UTC().Format(time.RFC3339) + image.Published = time.Now().UTC() nAttachment = append(nAttachment, image) @@ -1812,7 +1812,7 @@ func ParseCommentForReplies(db *sql.DB, comment string, op string) []ObjectBase if isValid { var reply = new(ObjectBase) reply.Id = links[i] - reply.Published = time.Now().UTC().Format(time.RFC3339) + reply.Published = time.Now().UTC() validLinks = append(validLinks, *reply) } } @@ -2397,7 +2397,7 @@ func ResizeAttachmentToPreview(db *sql.DB) { var mediatype string var name string var size int - var published string + var published time.Time rows.Scan(&id, &href, &mediatype, &name, &size, &published) |