From a221da8d306d805a60dde6c231d49ac8019fa8dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Herg=C3=A8s?= Date: Wed, 29 Oct 2025 21:44:38 +0100 Subject: feat(rss): more precise hour for new content --- backend/section.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'backend/section.go') diff --git a/backend/section.go b/backend/section.go index 0e31613..1333f87 100644 --- a/backend/section.go +++ b/backend/section.go @@ -20,6 +20,7 @@ import ( var ( sections = map[string]map[string]*sectionData{} + now = time.Now() ) type Section struct { @@ -50,7 +51,12 @@ func (d *sectionData) PubDate() string { } func (d *sectionData) PubDateRSS() string { - return d.PubLocalDate.AsTime(time.Local).Format(time.RFC1123Z) // because RFC822 in go isn't RFC822??? + t := d.PubLocalDate.AsTime(time.Local) + // if same day, assume that it's published now + if t.Year() == now.Year() && t.Month() == now.Month() && t.Day() == now.Day() { + t = now + } + return t.Format(time.RFC1123Z) // because RFC822 in go isn't RFC822??? } func (d *sectionData) Title() string { -- cgit v1.2.3