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

Move the utils.go file into the /utils directory

This commit is contained in:
Chris Cummer
2019-08-05 10:50:12 -07:00
parent 0bd2d176d8
commit 4e46fff145
57 changed files with 190 additions and 188 deletions

View File

@@ -3,7 +3,7 @@ package gcal
import (
"time"
"github.com/wtfutil/wtf/wtf"
"github.com/wtfutil/wtf/utils"
"google.golang.org/api/calendar/v3"
)
@@ -100,9 +100,9 @@ func (calEvent *CalEvent) Start() time.Time {
func (calEvent *CalEvent) Timestamp() string {
if calEvent.AllDay() {
startTime, _ := time.ParseInLocation("2006-01-02", calEvent.event.Start.Date, time.Local)
return startTime.Format(wtf.FriendlyDateFormat)
return startTime.Format(utils.FriendlyDateFormat)
}
startTime, _ := time.Parse(time.RFC3339, calEvent.event.Start.DateTime)
return startTime.Format(wtf.MinimumTimeFormat)
return startTime.Format(utils.MinimumTimeFormat)
}

View File

@@ -6,7 +6,7 @@ import (
"strings"
"time"
"github.com/wtfutil/wtf/wtf"
"github.com/wtfutil/wtf/utils"
)
func (widget *Widget) sortedEvents() ([]*CalEvent, []*CalEvent) {
@@ -98,7 +98,7 @@ func (widget *Widget) dayDivider(event, prevEvent *CalEvent) string {
return fmt.Sprintf("[%s::b]",
widget.settings.colors.day) +
event.Start().Format(wtf.FullDateFormat) +
event.Start().Format(utils.FullDateFormat) +
"\n"
}
@@ -169,7 +169,7 @@ func (widget *Widget) titleColor(calEvent *CalEvent) string {
color := widget.settings.colors.title
for _, untypedArr := range widget.settings.highlights {
highlightElements := wtf.ToStrs(untypedArr.([]interface{}))
highlightElements := utils.ToStrs(untypedArr.([]interface{}))
match, _ := regexp.MatchString(
strings.ToLower(highlightElements[0]),