本来の期限に加えて自分の中での目標期限を設定できるよう仕様追加

This commit is contained in:
2026-04-23 09:40:18 +09:00
parent b2dd70cf27
commit 098f636a65
11 changed files with 151 additions and 32 deletions

View File

@@ -25,11 +25,27 @@ func getFuncMap() template.FuncMap {
"formatDate": func(t time.Time) string {
return t.Format("2006/01/02")
},
"formatDateTime": func(t time.Time) string {
return t.Format("2006/01/02 15:04")
"formatDateTime": func(t interface{}) string {
switch v := t.(type) {
case time.Time:
return v.Format("2006/01/02 15:04")
case *time.Time:
if v != nil {
return v.Format("2006/01/02 15:04")
}
}
return ""
},
"formatDateInput": func(t time.Time) string {
return t.Format("2006-01-02T15:04")
"formatDateInput": func(t interface{}) string {
switch v := t.(type) {
case time.Time:
return v.Format("2006-01-02T15:04")
case *time.Time:
if v != nil {
return v.Format("2006-01-02T15:04")
}
}
return ""
},
"isOverdue": func(t time.Time, completed bool) bool {
return !completed && time.Now().After(t)