2021-01-23 12:26:26 +01:00
|
|
|
package task
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
2021-01-23 13:43:28 +01:00
|
|
|
type Date time.Time
|
|
|
|
|
|
|
|
func (d *Date) Weekday() Weekday {
|
|
|
|
return d.Weekday()
|
2021-01-23 12:26:26 +01:00
|
|
|
}
|
|
|
|
|
2021-01-23 13:43:28 +01:00
|
|
|
type Weekday time.Weekday
|
|
|
|
|
|
|
|
type Period int
|
2021-01-23 12:26:26 +01:00
|
|
|
|
|
|
|
type Task struct {
|
|
|
|
Action string
|
|
|
|
Due Date
|
|
|
|
}
|
|
|
|
|
|
|
|
type Recurrer interface {
|
|
|
|
FirstAfter(date Date) Date
|
|
|
|
}
|
|
|
|
|
|
|
|
type Weekly struct {
|
|
|
|
Start Date
|
|
|
|
Weekday Weekday
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *Weekly) FirstAfter(date Date) Date {
|
2021-01-23 13:43:28 +01:00
|
|
|
//sd := w.Start.Weekday()
|
|
|
|
|
2021-01-23 12:26:26 +01:00
|
|
|
return date
|
|
|
|
}
|
|
|
|
|
|
|
|
type BiWeekly struct {
|
|
|
|
Start Date
|
|
|
|
Weekday Weekday
|
|
|
|
}
|
|
|
|
|
|
|
|
type RecurringTask struct {
|
|
|
|
Action string
|
|
|
|
Start Date
|
|
|
|
Recurrer Recurrer
|
|
|
|
}
|