projects
/
brevno-suite
/
hugo
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
673e41b
)
hugolib: Handle unpecified date for IsFuture and IsExpired
author
Hanchen Wang
<hanchen.wang@mail.utoronto.ca>
Mon, 13 Jun 2016 15:37:10 +0000
(11:37 -0400)
committer
Bjørn Erik Pedersen
<bjorn.erik.pedersen@gmail.com>
Tue, 14 Jun 2016 13:45:26 +0000
(15:45 +0200)
hugolib/page.go
patch
|
blob
|
history
diff --git
a/hugolib/page.go
b/hugolib/page.go
index 3fd5309ed836de90d28671a4f6e36622e86e082b..5e3fe12311c171d9da32cf6950631ab16a967e07 100644
(file)
--- a/
hugolib/page.go
+++ b/
hugolib/page.go
@@
-491,10
+491,16
@@
func (p *Page) IsDraft() bool {
}
func (p *Page) IsFuture() bool {
+ if p.PublishDate.IsZero() {
+ return false
+ }
return p.PublishDate.After(time.Now())
}
func (p *Page) IsExpired() bool {
+ if p.ExpiryDate.IsZero() {
+ return false
+ }
return p.ExpiryDate.Before(time.Now())
}