1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Better calendar display

This commit is contained in:
Chris Cummer 2018-03-30 10:48:03 -07:00 committed by Chris Cummer
parent 4074893799
commit a09691c86f

View File

@ -54,11 +54,11 @@ func (widget *Widget) addView() {
}
func (widget *Widget) contentFrom(events *calendar.Events) string {
str := ""
str := "\n"
for _, item := range events.Items {
ts, _ := time.Parse(time.RFC3339, item.Start.DateTime)
timestamp := ts.Format("Mon Jan _2 15:04:05 2006")
timestamp := ts.Format("Mon, Jan 2 - 15:04")
str = str + fmt.Sprintf(" [%s]%s[white]\n [%s]%s[white]\n\n", titleColor(item), item.Summary, descriptionColor(item), timestamp)
}