mirror of
https://github.com/araddon/dateparse.git
synced 2025-01-19 03:06:11 +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,6 +269,12 @@ iterRunes:
|
|||||||
p.setMonth()
|
p.setMonth()
|
||||||
p.dayi = i + 1
|
p.dayi = i + 1
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if p.daylen == 0 {
|
||||||
|
p.daylen = i
|
||||||
|
p.setDay()
|
||||||
|
p.moi = i + 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -446,6 +452,12 @@ iterRunes:
|
|||||||
p.setDay()
|
p.setDay()
|
||||||
p.yeari = i + 1
|
p.yeari = i + 1
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if p.molen == 0 {
|
||||||
|
p.molen = i - p.moi
|
||||||
|
p.setMonth()
|
||||||
|
p.yeari = i + 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user