mirror of
https://github.com/araddon/dateparse.git
synced 2024-11-10 11:51:54 +08:00
New date format 1st November 2020
This commit is contained in:
parent
6b43995a97
commit
2c145040d4
@ -400,6 +400,14 @@ iterRunes:
|
|||||||
p.stateDate = dateDigitChineseYear
|
p.stateDate = dateDigitChineseYear
|
||||||
case ',':
|
case ',':
|
||||||
return nil, unknownErr(datestr)
|
return nil, unknownErr(datestr)
|
||||||
|
|
||||||
|
case 's', 'S', 'r', 'R', 't', 'T', 'n', 'N':
|
||||||
|
// 1st January 2018
|
||||||
|
// 2nd Jan 2018 23:59
|
||||||
|
// st, rd, nd, st
|
||||||
|
p.stateDate = dateAlphaWsMonthSuffix
|
||||||
|
i--
|
||||||
|
|
||||||
default:
|
default:
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -417,6 +417,14 @@ var testInputs = []dateTest{
|
|||||||
{in: "1384216367111", out: "2013-11-12 00:32:47.111 +0000 UTC"},
|
{in: "1384216367111", out: "2013-11-12 00:32:47.111 +0000 UTC"},
|
||||||
{in: "1384216367111222", out: "2013-11-12 00:32:47.111222 +0000 UTC"},
|
{in: "1384216367111222", out: "2013-11-12 00:32:47.111222 +0000 UTC"},
|
||||||
{in: "1384216367111222333", out: "2013-11-12 00:32:47.111222333 +0000 UTC"},
|
{in: "1384216367111222333", out: "2013-11-12 00:32:47.111222333 +0000 UTC"},
|
||||||
|
|
||||||
|
// dd[th,nd,st,rd] Month yyyy
|
||||||
|
{in: "1st September 2012", out: "2012-09-01 00:00:00 +0000 UTC"},
|
||||||
|
{in: "2nd September 2012", out: "2012-09-02 00:00:00 +0000 UTC"},
|
||||||
|
{in: "3rd September 2012", out: "2012-09-03 00:00:00 +0000 UTC"},
|
||||||
|
{in: "4th September 2012", out: "2012-09-04 00:00:00 +0000 UTC"},
|
||||||
|
{in: "2nd January 2018", out: "2018-01-02 00:00:00 +0000 UTC"},
|
||||||
|
{in: "3nd Feb 2018 13:58:24", out: "2018-02-03 13:58:24 +0000 UTC"},
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestParse(t *testing.T) {
|
func TestParse(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user