Merge pull request #1154 from gouguoyin/master

formatMonthDaySuffixMap() misjudged suffix
This commit is contained in:
John Guo 2021-02-02 13:16:17 +08:00 committed by GitHub
commit 930e63e6b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"