Subject: | _mungeDateTime fails to parse October dates |
Today (2015-10-01) the test suite fails:
# Failed test at t/01tests.t line 34.
# Failed test at t/01tests.t line 41.
# Failed test at t/01tests.t line 45.
# Failed test at t/01tests.t line 47.
# Looks like you failed 4 tests of 12.
t/01tests.t ......... Dubious, test returned 4 (wstat 1024, 0x400)
Failed 4/12 subtests
Seems that some dates are not parsed correctly:
$ perl -Mblib -e 'require Util::SelfDestruct; warn Util::SelfDestruct::_mungeDateTime("20161002")'
Warning: something's wrong at -e line 1.
$ perl -Mblib -e 'require Util::SelfDestruct; warn Util::SelfDestruct::_mungeDateTime("20160902")'
20160902000000 at -e line 1.
Looking at the regexp in _mungeDateTime it seems that
$isodate =~ /^\s*(19\d{2}|2\d{3})(0[1-9]|1[12])(0[1-9]|[12][0-9]|3[01])
should be
$isodate =~ /^\s*(19\d{2}|2\d{3})(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])