include time in imported posts
This commit is contained in:
parent
92f75a8871
commit
9dbf14c05e
1 changed files with 3 additions and 1 deletions
|
@ -9,6 +9,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/go-multierror"
|
"github.com/hashicorp/go-multierror"
|
||||||
"github.com/writeas/impart"
|
"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
|
coll.hostName = app.cfg.App.Host
|
||||||
|
created := info.ModTime().Truncate(time.Second).UTC().Format("2006-01-02T15:04:05Z")
|
||||||
submittedPost := SubmittedPost{
|
submittedPost := SubmittedPost{
|
||||||
Title: &post.Title,
|
Title: &post.Title,
|
||||||
Content: &post.Content,
|
Content: &post.Content,
|
||||||
Font: "norm",
|
Font: "norm",
|
||||||
|
Created: &created,
|
||||||
}
|
}
|
||||||
rp, err := app.db.CreatePost(u.ID, coll.ID, &submittedPost)
|
rp, err := app.db.CreatePost(u.ID, coll.ID, &submittedPost)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Add table
Reference in a new issue