mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Color 1on1 calendar events differently than other calendar events
This commit is contained in:
parent
1e7af63e63
commit
3393882dc8
@ -115,8 +115,7 @@ func Fetch() *calendar.Events {
|
||||
}
|
||||
|
||||
t := today().Format(time.RFC3339)
|
||||
events, err := srv.Events.List("primary").ShowDeleted(false).
|
||||
SingleEvents(true).TimeMin(t).MaxResults(10).OrderBy("startTime").Do()
|
||||
events, err := srv.Events.List("primary").ShowDeleted(false).SingleEvents(true).TimeMin(t).MaxResults(10).OrderBy("startTime").Do()
|
||||
if err != nil {
|
||||
log.Fatalf("Unable to retrieve next ten of the user's events. %v", err)
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package gcal
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/rivo/tview"
|
||||
@ -21,6 +22,10 @@ func Widget() tview.Primitive {
|
||||
timestamp := ts.Format("Mon Jan _2 15:04:05 2006")
|
||||
|
||||
color := "red"
|
||||
if strings.Contains(item.Summary, "1on1") {
|
||||
color = "green"
|
||||
}
|
||||
|
||||
if ts.Before(time.Now()) {
|
||||
color = "grey"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user