Add support for i3status-rust

This commit is contained in:
2021-04-29 10:11:51 -05:00
parent 00e13fc7ad
commit 2ba309fe36
3 changed files with 48 additions and 0 deletions

View File

@@ -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))
}