summaryrefslogtreecommitdiff
path: root/system/admin/handlers.go
diff options
context:
space:
mode:
authorSteve <nilslice@gmail.com>2016-10-17 21:31:59 -0700
committerGitHub <noreply@github.com>2016-10-17 21:31:59 -0700
commit2f3985491363dc0658ad8cf3a415a77c1825a67a (patch)
treefa398a23c9e247e9cc7515898f0f6ddabf392f64 /system/admin/handlers.go
parent9c8ed5c6a88901bf139bf9bb7b884b222c6053ce (diff)
parent30b47784c5889539a65cc292066a400aa19c35d0 (diff)
Merge pull request #2 from bosssauce/ponzu-dev
[core] move content.Item to unix-y Timestamp and Updated fields
Diffstat (limited to 'system/admin/handlers.go')
-rw-r--r--system/admin/handlers.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go
index d492335..edf351d 100644
--- a/system/admin/handlers.go
+++ b/system/admin/handlers.go
@@ -435,21 +435,18 @@ func editHandler(res http.ResponseWriter, req *http.Request) {
cid := req.FormValue("id")
t := req.FormValue("type")
ts := req.FormValue("timestamp")
+ up := req.FormValue("updated")
// create a timestamp if one was not set
- date := make(map[string]int)
if ts == "" {
- now := time.Now()
- date["year"] = now.Year()
- date["month"] = int(now.Month())
- date["day"] = now.Day()
-
- // create timestamp format 'yyyy-mm-dd' and set in PostForm for
- // db insertion
- ts = fmt.Sprintf("%d-%02d-%02d", date["year"], date["month"], date["day"])
+ ts := fmt.Sprintf("%d", time.Now().Unix()*1000)
req.PostForm.Set("timestamp", ts)
}
+ if up == "" {
+ req.PostForm.Set("updated", ts)
+ }
+
urlPaths, err := storeFileUploads(req)
if err != nil {
fmt.Println(err)