diff options
Diffstat (limited to 'hugolib/site.go')
-rw-r--r-- | hugolib/site.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hugolib/site.go b/hugolib/site.go index cf7f0ff82..cbfc4d836 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -30,6 +30,7 @@ import ( "strings" "time" + "github.com/gohugoio/hugo/common/htime" "github.com/gohugoio/hugo/common/hugio" "github.com/gohugoio/hugo/common/types" "github.com/gohugoio/hugo/modules" @@ -1910,10 +1911,11 @@ func shouldBuild(buildFuture bool, buildExpired bool, buildDrafts bool, Draft bo if !(buildDrafts || !Draft) { return false } - if !buildFuture && !publishDate.IsZero() && publishDate.After(time.Now()) { + hnow := htime.Now() + if !buildFuture && !publishDate.IsZero() && publishDate.After(hnow) { return false } - if !buildExpired && !expiryDate.IsZero() && expiryDate.Before(time.Now()) { + if !buildExpired && !expiryDate.IsZero() && expiryDate.Before(hnow) { return false } return true |