From 8e30297639bb1cca11db115a8bffead6710890d2 Mon Sep 17 00:00:00 2001 From: xing Date: Fri, 14 Apr 2023 20:39:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 96442f1..3bb4373 100644 --- a/main.go +++ b/main.go @@ -31,12 +31,12 @@ func fetch(u string, fn ...func(s string) string) string { return html } -func dayLimit(today, forwardDay int, s string) string { +func dayLimit(today, forwardDay int, s, format string) string { da := date.FindStringSubmatch(s) if len(da) <= 1 { return s } - t, err := time.Parse(time.RFC1123Z, da[1]) + t, err := time.Parse(format, da[1]) if err != nil { return s } @@ -48,7 +48,7 @@ func dayLimit(today, forwardDay int, s string) string { func filterItem(html string, today, recentDay int) string { return zhihuReg.ReplaceAllStringFunc(html, func(s string) string { - return dayLimit(today, recentDay, s) + return dayLimit(today, recentDay, s, time.RFC1123Z) }) }