1
0
Fork 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
1 changed files with 1 additions and 1 deletions

View File

@ -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 {