add todo.triggered to indicate should be set to todo
parent
a4cfc77e0a
commit
76008647c8
|
|
@ -1,8 +1,16 @@
|
|||
package pttodo
|
||||
|
||||
import "time"
|
||||
|
||||
type Todo struct {
|
||||
Todo string
|
||||
Detail string `yaml:",omitempty"`
|
||||
TS TS `yaml:",omitempty"`
|
||||
Schedule Schedule `yaml:",omitempty"`
|
||||
}
|
||||
|
||||
func (todo Todo) Triggered() bool {
|
||||
last := todo.TS
|
||||
next, err := todo.Schedule.Next(last.time())
|
||||
return err == nil && time.Now().After(next)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue