diff --git a/contrib/handlers/smbc.go b/contrib/handlers/smbc.go index 80effec8..ddbefbd8 100644 --- a/contrib/handlers/smbc.go +++ b/contrib/handlers/smbc.go @@ -13,7 +13,7 @@ import ( ) func parseSMBCDate(date string) (time.Time, error) { - t, err := time.Parse("2006/01/02", date) + t, err := time.Parse("2006/1/2", date) if err == nil { return t, nil } diff --git a/contrib/handlers/smbc_test.go b/contrib/handlers/smbc_test.go index 33c31873..4c6d32d1 100644 --- a/contrib/handlers/smbc_test.go +++ b/contrib/handlers/smbc_test.go @@ -23,6 +23,7 @@ func Test_parseSMBCDate(t *testing.T) { {input: "R01.05.01", expect: time.Date(2019, 5, 1, 0, 0, 0, 0, time.UTC), e: false}, {input: "R1.5.2", expect: time.Time{}, e: true}, {input: "2021/12/17", expect: time.Date(2021, 12, 17, 0, 0, 0, 0, time.UTC), e: false}, + {input: "2021/1/1", expect: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC), e: false}, } for _, c := range cases {