summaryrefslogtreecommitdiff
path: root/internal/models/atom.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/models/atom.go')
-rw-r--r--internal/models/atom.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/models/atom.go b/internal/models/atom.go
index b3a384a..10d14d1 100644
--- a/internal/models/atom.go
+++ b/internal/models/atom.go
@@ -37,13 +37,14 @@ type Atom struct {
SourceIcon string // e.g., "trello-icon.svg" or emoji
ColorClass string // e.g., "border-blue-500"
IsOverdue bool // True if due date is before today
+ IsFuture bool // True if due date is after today
HasSetTime bool // True if due time is not midnight (has specific time)
// Original Data (for write operations)
Raw interface{}
}
-// ComputeUIFields calculates IsOverdue and HasSetTime based on DueDate
+// ComputeUIFields calculates IsOverdue, IsFuture, and HasSetTime based on DueDate
func (a *Atom) ComputeUIFields() {
if a.DueDate == nil {
return
@@ -51,11 +52,15 @@ func (a *Atom) ComputeUIFields() {
now := time.Now()
today := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location())
+ tomorrow := today.AddDate(0, 0, 1)
// Check if overdue (due date is before today)
dueDay := time.Date(a.DueDate.Year(), a.DueDate.Month(), a.DueDate.Day(), 0, 0, 0, 0, a.DueDate.Location())
a.IsOverdue = dueDay.Before(today)
+ // Check if future (due date is after today)
+ a.IsFuture = !dueDay.Before(tomorrow)
+
// Check if has set time (not midnight)
a.HasSetTime = a.DueDate.Hour() != 0 || a.DueDate.Minute() != 0
}