better handling of times and places..

This commit is contained in:
Ted Unangst 2019-10-05 16:49:56 -04:00
parent d3cbf4c352
commit d08eab8712
1 changed files with 7 additions and 1 deletions

View File

@ -751,6 +751,8 @@ func xonksaver(user *WhatAbout, item junk.Junk, origin string) *Honk {
if err == nil { if err == nil {
t := new(Time) t := new(Time)
t.StartTime = start t.StartTime = start
endtime, _ := obj.GetString("endTime")
t.EndTime, _ = time.Parse(time.RFC3339, endtime)
dura, _ := obj.GetString("duration") dura, _ := obj.GetString("duration")
if strings.HasPrefix(dura, "PT") { if strings.HasPrefix(dura, "PT") {
dura = strings.ToLower(dura[2:]) dura = strings.ToLower(dura[2:])
@ -1045,8 +1047,12 @@ func jonkjonk(user *WhatAbout, h *Honk) (junk.Junk, junk.Junk) {
t["latitude"] = p.Latitude t["latitude"] = p.Latitude
t["longitude"] = p.Longitude t["longitude"] = p.Longitude
t["url"] = p.Url t["url"] = p.Url
if h.What == "event" {
jo["location"] = t
} else {
tags = append(tags, t) tags = append(tags, t)
} }
}
if len(tags) > 0 { if len(tags) > 0 {
jo["tag"] = tags jo["tag"] = tags
} }