From 9dbf14c05e149b52d52d40e16e96b577460ae929 Mon Sep 17 00:00:00 2001 From: Rob Loranger Date: Wed, 21 Aug 2019 10:07:30 -0700 Subject: [PATCH] include time in imported posts --- account_import.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/account_import.go b/account_import.go index c9868ba..f28017c 100644 --- a/account_import.go +++ b/account_import.go @@ -9,6 +9,7 @@ import ( "os" "path/filepath" "strings" + "time" "github.com/hashicorp/go-multierror" "github.com/writeas/impart" @@ -109,11 +110,12 @@ func handleImport(app *App, u *User, w http.ResponseWriter, r *http.Request) err } } coll.hostName = app.cfg.App.Host - + created := info.ModTime().Truncate(time.Second).UTC().Format("2006-01-02T15:04:05Z") submittedPost := SubmittedPost{ Title: &post.Title, Content: &post.Content, Font: "norm", + Created: &created, } rp, err := app.db.CreatePost(u.ID, coll.ID, &submittedPost) if err != nil {