1
0

In PostID() change date location to UTC and use seconds as part of ID as well.

This commit is contained in:
Alexander Andreev 2023-05-23 04:18:07 +04:00
parent 68e5f0129a
commit f1d6f5c736
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -41,7 +41,7 @@ func NewPost(category Category, title, body string) (*Post, error) {
func (p *Post) PostID() string { func (p *Post) PostID() string {
name := strings.ToLower(p.Category.Name) name := strings.ToLower(p.Category.Name)
name = strings.ReplaceAll(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 { type Mindflow interface {