diff options
author | satotake <[email protected]> | 2022-04-27 02:57:04 +0900 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2022-05-08 16:56:26 +0200 |
commit | e77ca3c105bd64c5077d823d2127f6f812a4f681 (patch) | |
tree | ebbe9c310bfab1e34f9fd2e36b738fd2a37d6f11 /resources | |
parent | f2946da9e806c2bafbdd26707fe339db79bd980b (diff) | |
download | hugo-e77ca3c105bd64c5077d823d2127f6f812a4f681.tar.gz hugo-e77ca3c105bd64c5077d823d2127f6f812a4f681.zip |
Add `clock` cli flag
Close #8787
Diffstat (limited to 'resources')
-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. |