include time in imported posts

import-zips
Rob Loranger 5 years ago
parent 92f75a8871
commit 9dbf14c05e
No known key found for this signature in database
GPG Key ID: D6F1633A4F0903B8
  1. 4
      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 {

Loading…
Cancel
Save