mirror of
https://github.com/araddon/dateparse.git
synced 2024-11-10 11:51:54 +08:00
add missing 07 Feb 2004 09:07:05 format
This commit is contained in:
parent
fcd5cbafcd
commit
c9a50ad15e
13
parseany.go
13
parseany.go
@ -11,6 +11,11 @@ import (
|
|||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// func init() {
|
||||||
|
// gou.SetupLogging("debug")
|
||||||
|
// gou.SetColorOutput()
|
||||||
|
// }
|
||||||
|
|
||||||
type dateState uint8
|
type dateState uint8
|
||||||
type timeState uint8
|
type timeState uint8
|
||||||
|
|
||||||
@ -528,10 +533,10 @@ iterRunes:
|
|||||||
p.setYear()
|
p.setYear()
|
||||||
i++
|
i++
|
||||||
break iterRunes
|
break iterRunes
|
||||||
// case ' ':
|
case ' ':
|
||||||
// p.yearlen = i - p.yeari
|
p.yearlen = i - p.yeari
|
||||||
// p.setYear()
|
p.setYear()
|
||||||
// break iterRunes
|
break iterRunes
|
||||||
}
|
}
|
||||||
case dateDigitWsMolong:
|
case dateDigitWsMolong:
|
||||||
// 18 January 2018
|
// 18 January 2018
|
||||||
|
@ -199,6 +199,11 @@ var testInputs = []dateTest{
|
|||||||
{in: "07 Feb 2004, 09:07:07", out: "2004-02-07 09:07:07 +0000 UTC"},
|
{in: "07 Feb 2004, 09:07:07", out: "2004-02-07 09:07:07 +0000 UTC"},
|
||||||
{in: "7 Feb 2004, 09:07:07", out: "2004-02-07 09:07:07 +0000 UTC"},
|
{in: "7 Feb 2004, 09:07:07", out: "2004-02-07 09:07:07 +0000 UTC"},
|
||||||
{in: "07 Feb 2004, 9:7:7", out: "2004-02-07 09:07:07 +0000 UTC"},
|
{in: "07 Feb 2004, 9:7:7", out: "2004-02-07 09:07:07 +0000 UTC"},
|
||||||
|
// DD Mon yyyy hh:mm:ss
|
||||||
|
{in: "07 Feb 2004 09:07:08", out: "2004-02-07 09:07:08 +0000 UTC"},
|
||||||
|
{in: "07 Feb 2004 09:07", out: "2004-02-07 09:07:00 +0000 UTC"},
|
||||||
|
{in: "7 Feb 2004 9:7:8", out: "2004-02-07 09:07:08 +0000 UTC"},
|
||||||
|
{in: "07 Feb 2004 09:07:08.123", out: "2004-02-07 09:07:08.123 +0000 UTC"},
|
||||||
// 12 Feb 2006, 19:17:08 GMT
|
// 12 Feb 2006, 19:17:08 GMT
|
||||||
{in: "07 Feb 2004, 09:07:07 GMT", out: "2004-02-07 09:07:07 +0000 UTC"},
|
{in: "07 Feb 2004, 09:07:07 GMT", out: "2004-02-07 09:07:07 +0000 UTC"},
|
||||||
// 12 Feb 2006, 19:17:08 +0100
|
// 12 Feb 2006, 19:17:08 +0100
|
||||||
|
Loading…
Reference in New Issue
Block a user