Skip to content

Commit 0d74ffc

Browse files
authored
Merge pull request #84 from ferhatelmas/ordinal-fix
Fix ordinal parsing due to copy
2 parents 2df4713 + b0e1413 commit 0d74ffc

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

parseany.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ iterRunes:
781781
// April 8th 2009
782782
switch r {
783783
case 't', 'T':
784-
if p.nextIs(i, 'h') || p.nextIs(i, 'h') {
784+
if p.nextIs(i, 'h') || p.nextIs(i, 'H') {
785785
if len(datestr) > i+2 {
786786
return parseTime(fmt.Sprintf("%s%s", p.datestr[0:i], p.datestr[i+2:]), loc)
787787
}

parseany_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ var testInputs = []dateTest{
9393
{in: "September 17th 2012", out: "2012-09-17 00:00:00 +0000 UTC"},
9494
{in: "September 7th, 2012", out: "2012-09-07 00:00:00 +0000 UTC"},
9595
{in: "September 7th 2012", out: "2012-09-07 00:00:00 +0000 UTC"},
96+
{in: "September 7tH 2012", out: "2012-09-07 00:00:00 +0000 UTC"},
9697
{in: "May 1st 2012", out: "2012-05-01 00:00:00 +0000 UTC"},
9798
{in: "May 1st, 2012", out: "2012-05-01 00:00:00 +0000 UTC"},
9899
{in: "May 21st 2012", out: "2012-05-21 00:00:00 +0000 UTC"},

0 commit comments

Comments
 (0)