From 28f83d3d324477734fb8a122ae5b5ef2895e8236 Mon Sep 17 00:00:00 2001 From: gouguoyin <245629560@qq.com> Date: Sun, 31 Jan 2021 15:40:27 +0800 Subject: [PATCH] formatMonthDaySuffixMap() misjudged suffix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit when day is 21,abbreviated as 21st,suffix is st ,is not th when day is 22,abbreviated as 22nd,suffix is nd ,is not th when day is 23,abbreviated as 23rd,suffix is rd ,is not th when day is 31,abbreviated as 31st,suffix is st ,is not th --- os/gtime/gtime_format.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/os/gtime/gtime_format.go b/os/gtime/gtime_format.go index 9b87c12b5..a0c563332 100644 --- a/os/gtime/gtime_format.go +++ b/os/gtime/gtime_format.go @@ -266,11 +266,11 @@ func formatToRegexPattern(format string) string { // formatMonthDaySuffixMap returns the short english word for current day. func formatMonthDaySuffixMap(day string) string { switch day { - case "01": + case "01", "21", "31": return "st" - case "02": + case "02", "22": return "nd" - case "03": + case "03", "23": return "rd" default: return "th"