summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2022-10-27 10:47:06 +0200
committerGitHub <noreply@github.com>2022-10-27 10:47:06 +0200
commit4d39fd8aaec48d99d845b877b94ee58763ccccab (patch)
tree5294dd4bc09a8dac7ed85d517c5eaad480365de8
parent Revert: auto generate INTERNAL_TOKEN (#21608) (#21609) (diff)
downloadforgejo-4d39fd8aaec48d99d845b877b94ee58763ccccab.tar.xz
forgejo-4d39fd8aaec48d99d845b877b94ee58763ccccab.zip
Fix `Timestamp.IsZero` (#21593) (#21603)
Backport of #21593 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
-rw-r--r--modules/timeutil/timestamp.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/timeutil/timestamp.go b/modules/timeutil/timestamp.go
index 40fcb8603f..36b2aff575 100644
--- a/modules/timeutil/timestamp.go
+++ b/modules/timeutil/timestamp.go
@@ -103,5 +103,5 @@ func (ts TimeStamp) FormatDate() string {
// IsZero is zero time
func (ts TimeStamp) IsZero() bool {
- return ts.AsTimeInLocation(time.Local).IsZero()
+ return int64(ts) == 0
}