mirror of
https://github.com/araddon/dateparse.git
synced 2025-01-18 10:53:51 +08:00
Changes to the algorithm to handle when preferMonthFirst is false
Credit for this to KamalGalrani
This commit is contained in:
parent
0fb0a474d1
commit
d530bcec9b
12
parseany.go
12
parseany.go
@ -269,8 +269,14 @@ iterRunes:
|
||||
p.setMonth()
|
||||
p.dayi = i + 1
|
||||
}
|
||||
} else {
|
||||
if p.daylen == 0 {
|
||||
p.daylen = i
|
||||
p.setDay()
|
||||
p.moi = i + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case '.':
|
||||
// 3.31.2014
|
||||
@ -446,8 +452,14 @@ iterRunes:
|
||||
p.setDay()
|
||||
p.yeari = i + 1
|
||||
}
|
||||
} else {
|
||||
if p.molen == 0 {
|
||||
p.molen = i - p.moi
|
||||
p.setMonth()
|
||||
p.yeari = i + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case dateDigitWs:
|
||||
// 18 January 2018
|
||||
|
Loading…
Reference in New Issue
Block a user