diff --git a/server/backend/movie.go b/server/backend/movie.go index ca92af1b..e28794bc 100644 --- a/server/backend/movie.go +++ b/server/backend/movie.go @@ -52,7 +52,7 @@ func (s *CampusServer) getMovies(ctx context.Context, lastID int32, oldestDateAt tx := s.db.WithContext(ctx). Joins("File"). Order("date ASC") - if oldestDateAt.Second() != 0 || oldestDateAt.Nanosecond() != 0 { + if !oldestDateAt.IsZero() { tx = tx.Where("date > ?", oldestDateAt) } if err := tx.Find(&movies, "kino > ?", lastID).Error; err != nil { diff --git a/server/backend/news.go b/server/backend/news.go index b0ef471b..e3ef036f 100644 --- a/server/backend/news.go +++ b/server/backend/news.go @@ -97,7 +97,7 @@ func (s *CampusServer) getNews(ctx context.Context, sourceID int32, lastNewsID i if sourceID != 0 { tx = tx.Where("src = ?", sourceID) } - if oldestDateAt.Second() != 0 || oldestDateAt.Nanosecond() != 0 { + if !oldestDateAt.IsZero() { tx = tx.Where("date > ?", oldestDateAt) } if lastNewsID != 0 {