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

Adds in Google Calendar and Weather support (hard-coded right now)

This commit is contained in:
Chris Cummer
2018-03-28 19:40:20 -07:00
committed by Chris Cummer
parent 176052c78f
commit 8946e5cf24
12 changed files with 301 additions and 27 deletions

26
bamboohr/widget.go Normal file
View File

@@ -0,0 +1,26 @@
package bamboohr
import (
"fmt"
"github.com/rivo/tview"
)
func Widget() tview.Primitive {
items := Fetch()
widget := tview.NewTextView()
widget.SetBorder(true)
widget.SetDynamicColors(true)
widget.SetTitle(" 🐨 Away ")
data := ""
for _, item := range items {
str := fmt.Sprintf(" [green]%s[white]\n %s - %s\n\n", item.Name(), item.PrettyStart(), item.PrettyEnd())
data = data + str
}
fmt.Fprintf(widget, "%s", data)
return widget
}