Explorar o código

Add workaround for parsing an invalid date

Frédéric Guillot %!s(int64=5) %!d(string=hai) anos
pai
achega
bfb96d536e
Modificáronse 2 ficheiros con 2 adicións e 0 borrados
  1. 1 0
      reader/date/parser.go
  2. 1 0
      reader/date/parser_test.go

+ 1 - 0
reader/date/parser.go

@@ -156,6 +156,7 @@ var dateFormats = []string{
 	"2006-01-02T15:04:05 -0700",
 	"2006-01-02T15:04:05:00",
 	"2006-01-02T15:04:05",
+	"2006-01-02T15:04",
 	"2006-01-02 at 15:04:05",
 	"2006-01-02 15:04:05Z",
 	"2006-01-02 15:04:05 MST",

+ 1 - 0
reader/date/parser_test.go

@@ -132,6 +132,7 @@ func TestParseWeirdDateFormat(t *testing.T) {
 		"March 30 2020 07:02:38 PM",
 		"Mon, 30 Mar 2020 19:53 +0000",
 		"Mon, 03/30/2020 - 19:19",
+		"2018-12-12T12:12",
 	}
 
 	for _, date := range dates {