From 85ec902cfdbc27fe865afdc6e50c267886baf9dd Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Mon, 25 Oct 2021 13:45:30 -0400 Subject: [PATCH] preserve event time information when editing --- web.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/web.go b/web.go index 55d195e..c51793a 100644 --- a/web.go +++ b/web.go @@ -1396,8 +1396,10 @@ func edithonkpage(w http.ResponseWriter, r *http.Request) { templinfo["SavedPlace"] = honk.Place if tm := honk.Time; tm != nil { templinfo["ShowTime"] = ";" - templinfo["StartTime"] = tm.StartTime.Format("2006-01-02 03:04") - templinfo["Duration"] = tm.Duration + templinfo["StartTime"] = tm.StartTime.Format("2006-01-02 15:04") + if tm.Duration != 0 { + templinfo["Duration"] = tm.Duration + } } templinfo["ServerMessage"] = "honk edit 2" templinfo["IsPreview"] = true @@ -1711,8 +1713,10 @@ func submithonk(w http.ResponseWriter, r *http.Request) *Honk { templinfo["SavedFile"] = donkxid if tm := honk.Time; tm != nil { templinfo["ShowTime"] = ";" - templinfo["StartTime"] = tm.StartTime.Format("2006-01-02 03:04") - templinfo["Duration"] = tm.Duration + templinfo["StartTime"] = tm.StartTime.Format("2006-01-02 15:04") + if tm.Duration != 0 { + templinfo["Duration"] = tm.Duration + } } templinfo["IsPreview"] = true templinfo["UpdateXID"] = updatexid