Skip to content

Commit

Permalink
fix daysAgo func
Browse files Browse the repository at this point in the history
  • Loading branch information
jreisinger committed Sep 2, 2024
1 parent 84c8ea3 commit 43bedd6
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions report.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,7 @@ func buildHeader(start, end time.Time) string {
}

func daysAgo(t time.Time) int {
milliSeconds := int(time.Since(t).Milliseconds()) // milliseconds per day: 1000 * 60 * 60 * 24
if milliSeconds < 0 {
return -1
}
if milliSeconds/(1000*60*60) < 24 {
return 0
}
return milliSeconds / (1000 * 60 * 60 * 24)
return int(time.Since(t).Round(time.Hour*24).Hours() / 24)
}

func getDay(i int) string {
Expand Down

0 comments on commit 43bedd6

Please sign in to comment.