diff --git a/pkg/internal/services/posts.go b/pkg/internal/services/posts.go index 1cef8ea..9bb43ff 100644 --- a/pkg/internal/services/posts.go +++ b/pkg/internal/services/posts.go @@ -371,7 +371,7 @@ func NewPost(user models.Publisher, item models.Post) (models.Post, error) { if item.Alias != nil && len(*item.Alias) == 0 { item.Alias = nil } - if item.PublishedAt != nil && item.PublishedAt.Unix() < time.Now().Unix() { + if item.PublishedAt != nil && item.PublishedAt.UTC().Unix() < time.Now().UTC().Unix() { return item, fmt.Errorf("post cannot be published before now") } @@ -460,7 +460,7 @@ func EditPost(item models.Post) (models.Post, error) { if item.Alias != nil && len(*item.Alias) == 0 { item.Alias = nil } - if item.PublishedAt != nil && item.PublishedAt.Unix() < item.CreatedAt.Unix() { + if item.PublishedAt != nil && item.PublishedAt.UTC().Unix() < item.CreatedAt.UTC().Unix() { return item, fmt.Errorf("post cannot be published before it is created") }