mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-08 14:03:23 +00:00
Allow parsing year "00" with "yy" pattern (#24785)
The "yy" pattern is relative to the current century, so year "00" should
be valid.
(cherry picked from commit 1d32607575)
This commit is contained in:
@@ -2016,7 +2016,6 @@ proc parsePattern(input: string, pattern: FormatPattern, i: var int,
|
||||
var year = takeInt(2..2)
|
||||
var thisCen = now().year div 100
|
||||
parsed.year = some(thisCen*100 + year)
|
||||
result = year > 0
|
||||
of yyyy:
|
||||
let year =
|
||||
if input[i] in {'+', '-'}:
|
||||
|
||||
Reference in New Issue
Block a user