The attached patch (code & test) fixes this issue.
If you need the patch in some other format (or have a git repo for me to
clone), just drop me a line...
hm, now that I take a close look at the subject line, I'm not sure it
fixes that issue, but it does fix
perl -MDateTime::Format::ISO8601 -E 'say
DateTime::Format::ISO8601->parse_datetime("2011-07-04T20:50:23+0200")'
which currently does not work (but "2011-07-04T20:50:23+02:00" works,
note the ":" in the timezone)
diff -r -u DateTime-Format-ISO8601-0.07/lib/DateTime/Format/ISO8601.pm DateTime-Format-ISO8601-0.07_patched/lib/DateTime/Format/ISO8601.pm
--- DateTime-Format-ISO8601-0.07/lib/DateTime/Format/ISO8601.pm 2010-01-18 07:36:55.000000000 +0100
+++ DateTime-Format-ISO8601-0.07_patched/lib/DateTime/Format/ISO8601.pm 2011-07-04 21:01:07.265826915 +0200
@@ -669,7 +669,7 @@
{
#YYYYMMDDThhmmss[+-]hhmm 19850412T101530+0400
#YYYY-MM-DDThh:mm:ss[+-]hh:mm 1985-04-12T10:15:30+04:00
- length => [ qw( 20 25 ) ],
+ length => [ qw( 20 24 25 ) ],
regex => qr/^ (\d{4}) -?? (\d\d) -?? (\d\d)
T (\d\d) :?? (\d\d) :?? (\d\d) ([+-] \d\d :?? \d\d) $/x,
params => [ qw( year month day hour minute second time_zone ) ],
diff -r -u DateTime-Format-ISO8601-0.07/t/02_examples.t DateTime-Format-ISO8601-0.07_patched/t/02_examples.t
--- DateTime-Format-ISO8601-0.07/t/02_examples.t 2010-01-18 07:36:55.000000000 +0100
+++ DateTime-Format-ISO8601-0.07_patched/t/02_examples.t 2011-07-04 21:01:33.365791500 +0200
@@ -9,7 +9,7 @@
use lib qw( ./lib );
-use Test::More tests => 174;
+use Test::More tests => 176;
use DateTime::Format::ISO8601;
@@ -610,6 +610,12 @@
is( $dt->iso8601, '1985-04-12T10:15:30' );
is( $dt->time_zone->name, '+0400' );
}
+{
+ #YYYY-MM-DDThh:mm:ss+hh:mm 1985-04-12T10:15:30+0400
+ my $dt = $iso8601->parse_datetime( '1985-04-12T10:15:30+0400' );
+ is( $dt->iso8601, '1985-04-12T10:15:30' );
+ is( $dt->time_zone->name, '+0400' );
+}
{
#YYYYMMDDThhmmss.ss+hhmm 19850412T101530.5+0400