From 9851a8caac756f2b3aed0c2ceb171c16e1a00f6f Mon Sep 17 00:00:00 2001 From: Nicolas JUHEL Date: Wed, 29 Nov 2023 14:31:39 +0100 Subject: [PATCH] Package duration: fix bug format Days return Hours and not Days --- duration/format.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duration/format.go b/duration/format.go index 75a7b33d..0069406b 100644 --- a/duration/format.go +++ b/duration/format.go @@ -41,7 +41,7 @@ func (d Duration) String() string { } func (d Duration) Days() int64 { - t := math.Floor(d.Time().Hours()) + t := math.Ceil(d.Time().Hours() / 24) if t > math.MaxInt64 { return math.MaxInt64