MCPcopy Create free account
hub / github.com/Facets-cloud/flow / daysInStatus

Function daysInStatus

internal/app/show.go:653–663  ·  view source on GitHub ↗

daysInStatus returns the number of days the task has been in its current status. Uses status_changed_at if set, else falls back to created_at.

(t *flowdb.Task, now time.Time)

Source from the content-addressed store, hash-verified

651// current status. Uses status_changed_at if set, else falls back to
652// created_at.
653func daysInStatus(t *flowdb.Task, now time.Time) int {
654 ref := t.CreatedAt
655 if t.StatusChangedAt.Valid && t.StatusChangedAt.String != "" {
656 ref = t.StatusChangedAt.String
657 }
658 parsed, err := time.Parse(time.RFC3339, ref)
659 if err != nil {
660 return 0
661 }
662 return int(now.Sub(parsed) / (24 * time.Hour))
663}
664
665// daysUntilDue returns the number of days until the due date. Negative
666// means overdue. Returns (0, false) if no due date is set.

Callers 2

temporalSummaryFunction · 0.85
listTasksCmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected