diff --git a/app/product_notices.go b/app/product_notices.go index 2586cc5c6c..7e91cc4628 100644 --- a/app/product_notices.go +++ b/app/product_notices.go @@ -83,12 +83,13 @@ func noticeMatchesConditions(config *model.Config, preferences store.PreferenceS // check if notice date range matches current if cnd.DisplayDate != nil { - now := time.Now().UTC().Truncate(time.Hour * 24) + y, m, d := time.Now().UTC().Date() + trunc := time.Date(y, m, d, 0, 0, 0, 0, time.UTC) c, err2 := date_constraints.NewConstraint(*cnd.DisplayDate) if err2 != nil { return false, errors.Wrapf(err2, "Cannot parse date range %s", *cnd.DisplayDate) } - if !c.Check(&now) { + if !c.Check(&trunc) { return false, nil } }