We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 71eb03d + d162d5d commit 21b5a6cCopy full SHA for 21b5a6c
manager/utils.go
@@ -58,5 +58,10 @@ func formatTime(time *time.Time) string {
58
59
// Returns the number of years that have passed since the given date
60
func yearsSince(date *time.Time) int {
61
- return int(time.Since(*date).Hours() / float64(24*356))
+ today := time.Now()
62
+ years := today.Year() - date.Year()
63
+ if today.Month() < date.Month() || today.Month() == date.Month() && today.Day() < date.Day() {
64
+ years--
65
+ }
66
+ return years
67
}
0 commit comments