mirror of
https://github.com/araddon/dateparse.git
synced 2024-11-10 11:51:54 +08:00
Fix ordinal parsing due to copy
This commit is contained in:
parent
2df4713d07
commit
b0e14136e9
@ -781,7 +781,7 @@ iterRunes:
|
|||||||
// April 8th 2009
|
// April 8th 2009
|
||||||
switch r {
|
switch r {
|
||||||
case 't', 'T':
|
case 't', 'T':
|
||||||
if p.nextIs(i, 'h') || p.nextIs(i, 'h') {
|
if p.nextIs(i, 'h') || p.nextIs(i, 'H') {
|
||||||
if len(datestr) > i+2 {
|
if len(datestr) > i+2 {
|
||||||
return parseTime(fmt.Sprintf("%s%s", p.datestr[0:i], p.datestr[i+2:]), loc)
|
return parseTime(fmt.Sprintf("%s%s", p.datestr[0:i], p.datestr[i+2:]), loc)
|
||||||
}
|
}
|
||||||
|
@ -93,6 +93,7 @@ var testInputs = []dateTest{
|
|||||||
{in: "September 17th 2012", out: "2012-09-17 00:00:00 +0000 UTC"},
|
{in: "September 17th 2012", out: "2012-09-17 00:00:00 +0000 UTC"},
|
||||||
{in: "September 7th, 2012", out: "2012-09-07 00:00:00 +0000 UTC"},
|
{in: "September 7th, 2012", out: "2012-09-07 00:00:00 +0000 UTC"},
|
||||||
{in: "September 7th 2012", out: "2012-09-07 00:00:00 +0000 UTC"},
|
{in: "September 7th 2012", out: "2012-09-07 00:00:00 +0000 UTC"},
|
||||||
|
{in: "September 7tH 2012", out: "2012-09-07 00:00:00 +0000 UTC"},
|
||||||
{in: "May 1st 2012", out: "2012-05-01 00:00:00 +0000 UTC"},
|
{in: "May 1st 2012", out: "2012-05-01 00:00:00 +0000 UTC"},
|
||||||
{in: "May 1st, 2012", out: "2012-05-01 00:00:00 +0000 UTC"},
|
{in: "May 1st, 2012", out: "2012-05-01 00:00:00 +0000 UTC"},
|
||||||
{in: "May 21st 2012", out: "2012-05-21 00:00:00 +0000 UTC"},
|
{in: "May 21st 2012", out: "2012-05-21 00:00:00 +0000 UTC"},
|
||||||
|
Loading…
Reference in New Issue
Block a user