diff options
Diffstat (limited to 'resources/resource/dates.go')
-rw-r--r-- | resources/resource/dates.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/resources/resource/dates.go b/resources/resource/dates.go index b43f35c64..6d19ca7b9 100644 --- a/resources/resource/dates.go +++ b/resources/resource/dates.go @@ -13,7 +13,11 @@ package resource -import "time" +import ( + "time" + + "github.com/gohugoio/hugo/common/htime" +) var _ Dated = Dates{} @@ -55,7 +59,8 @@ func IsFuture(d Dated) bool { if d.PublishDate().IsZero() { return false } - return d.PublishDate().After(time.Now()) + + return d.PublishDate().After(htime.Now()) } // IsExpired returns whether the argument is expired. @@ -63,7 +68,7 @@ func IsExpired(d Dated) bool { if d.ExpiryDate().IsZero() { return false } - return d.ExpiryDate().Before(time.Now()) + return d.ExpiryDate().Before(htime.Now()) } // IsZeroDates returns true if all of the dates are zero. |