From f1d6f5c736691866bc18e16634c790b511d12b0b Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Tue, 23 May 2023 04:18:07 +0400 Subject: [PATCH] In PostID() change date location to UTC and use seconds as part of ID as well. --- pkg/mindflow/mindflow.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/mindflow/mindflow.go b/pkg/mindflow/mindflow.go index 14bef3e..327c37e 100644 --- a/pkg/mindflow/mindflow.go +++ b/pkg/mindflow/mindflow.go @@ -41,7 +41,7 @@ func NewPost(category Category, title, body string) (*Post, error) { func (p *Post) PostID() string { name := strings.ToLower(p.Category.Name) name = strings.ReplaceAll(name, " ", ".") - return fmt.Sprint(name, "-", p.Date.Format("20060102-1504")) + return fmt.Sprint(name, "-", p.Date.UTC().Format("20060102-150405")) } type Mindflow interface {