Add support for i3status-rust
This commit is contained in:
15
helpers.go
15
helpers.go
@@ -3,7 +3,10 @@ package main
|
||||
import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
"unicode"
|
||||
|
||||
todotxt "git.bullercodeworks.com/brian/go-todotxt"
|
||||
)
|
||||
|
||||
func itoa(val int) string {
|
||||
@@ -76,3 +79,15 @@ func sliceIsValidTags(v []string) bool {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func copyTaskList(t todotxt.TaskList) todotxt.TaskList {
|
||||
re := todotxt.NewTaskList()
|
||||
for _, v := range t {
|
||||
re.AddTask(&v)
|
||||
}
|
||||
return *re
|
||||
}
|
||||
|
||||
func dateWithinNextDay(d time.Time) bool {
|
||||
return !d.IsZero() && d.Before(time.Now().Add(time.Hour*24))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user