Ignore post `created` date when empty on publish

This commit is contained in:
Matt Baer 2021-08-30 17:48:30 -04:00
parent 2a0298cd46
commit 3270470b68
1 changed files with 1 additions and 1 deletions

View File

@ -661,7 +661,7 @@ func (db *datastore) CreatePost(userID, collID int64, post *SubmittedPost) (*Pos
// SQLite stores datetimes in UTC, so convert time.Now() to it here
created = created.UTC()
}
if post.Created != nil {
if post.Created != nil && *post.Created != "" {
created, err = time.Parse("2006-01-02T15:04:05Z", *post.Created)
if err != nil {
log.Error("Unable to parse Created time '%s': %v", *post.Created, err)