eat my own dogfood, subtasks
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package pttodo
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Todo struct {
|
||||
Todo string
|
||||
@@ -8,6 +11,7 @@ type Todo struct {
|
||||
TS TS `yaml:",omitempty"`
|
||||
Schedule Schedule `yaml:",omitempty"`
|
||||
Tags string `yaml:",omitempty"`
|
||||
Subtasks []Todo `yaml:",omitempty"`
|
||||
}
|
||||
|
||||
func (todo Todo) Triggered() bool {
|
||||
@@ -17,7 +21,7 @@ func (todo Todo) Triggered() bool {
|
||||
}
|
||||
|
||||
func (todo Todo) MarshalYAML() (interface{}, error) {
|
||||
if todo == (Todo{Todo: todo.Todo}) {
|
||||
if fmt.Sprint(todo) == fmt.Sprint(Todo{Todo: todo.Todo}) {
|
||||
return todo.Todo, nil
|
||||
}
|
||||
type Alt Todo
|
||||
|
||||
Reference in New Issue
Block a user