Skip Menu |

This queue is for tickets about the DateTime-Format-CLDR CPAN distribution.

Report information
The Basics
Id: 107389
Status: open
Priority: 0/
Queue: DateTime-Format-CLDR

People
Owner: Nobody in particular
Requestors: bbkr [...] post.pl
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 1.15
Fixed in: 1.17



Subject: Long year captures short year by mistake
https://github.com/maros/DateTime-Format-CLDR/blob/master/lib/DateTime/Format/CLDR.pm#L28 Because short year \d{2} is not excluded from range the parser incorrectly matches 04-01-15 to pattern yyyy-MM-dd and returns it as year 0004 instead of fail. Module should follow rules in: http://search.cpan.org/~drolsky/DateTime-1.20/lib/DateTime.pm#CLDR_Patterns y and y{3,} - long form yy - special case of short form u{1,} - same as y but without short form exception
This issue has been fixed in 1.17 (Fri Oct 16 2015)
From: bbkr [...] post.pl
Hi The bug is still there. year_long => qr/(-?\d{1,4})/o, year_short => qr/(-?\d{2})/o, Those two regexps MUST be mutually exclusive. While now both will capture "04". Correct regexp for year_long should be \d|\d{3,} (exactly one digit or three or more digits, two digits MUST NOT match).