2
0
mirror of https://github.com/araddon/dateparse.git synced 2025-10-26 08:16:12 +08:00

完善代码

This commit is contained in:
liushaobo
2021-02-04 15:51:24 +08:00
parent a7e3619d47
commit e92c493a75
3 changed files with 44 additions and 27 deletions

View File

@@ -296,6 +296,7 @@ iterRunes:
p.stateDate = dateDigitDash
}
case '/':
// 08/May/2005
// 03/31/2005
// 2014/02/24
p.stateDate = dateDigitSlash
@@ -383,7 +384,7 @@ iterRunes:
case dateDigitSt:
p.set(0, "060102")
i = i -1
i = i - 1
p.stateTime = timeStart
break iterRunes
case dateYearDash:
@@ -451,6 +452,12 @@ iterRunes:
p.set(p.moi, "Jan")
p.yeari = i + 1
p.stateDate = dateDigitDashAlphaDash
case '/':
p.set(0, "02")
p.molen = i - p.moi
p.set(p.moi, "Jan")
p.yeari = i + 1
p.stateDate = dateDigitSlash
}
case dateDigitDashAlphaDash:
@@ -539,6 +546,11 @@ iterRunes:
p.yeari = i + 1
}
}
default:
if unicode.IsLetter(r) {
p.moi = i
p.stateDate = dateDigitDashAlpha
}
}
case dateDigitColon: