In PostID() change date location to UTC and use seconds as part of ID as well.
This commit is contained in:
parent
68e5f0129a
commit
f1d6f5c736
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user