Imported Upstream version 0.08
Salvatore Bonaccorso
12 years ago
0 | 0 |
Revision history for Perl module DateTime::Format::ISO8601
|
|
1 |
|
|
2 |
0.08 Sat Feb 11 23:40:43 MST 2012
|
|
3 |
- rt.cpan.org #52645 : UTC offsets must be in the same format
|
|
4 |
(basic|extended) as the time as to which it is attached.
|
1 | 5 |
|
2 | 6 |
0.07 Sun Jan 17 23:35:40 MST 2010
|
3 | 7 |
- fix test failures caused by tests using DateTime->now(), all tests should
|
13 | 13 |
t/03_base_datetime.t
|
14 | 14 |
t/04_legacy_year.t
|
15 | 15 |
t/05_cut_off_year.t
|
|
16 |
t/06_bad_formats.t
|
16 | 17 |
t/99_pod.t
|
|
18 |
META.json
|
|
0 |
{
|
|
1 |
"abstract" : "Parses ISO8601 formats",
|
|
2 |
"author" : [
|
|
3 |
"Joshua Hoblitt <jhoblitt@cpan.org>"
|
|
4 |
],
|
|
5 |
"dynamic_config" : 1,
|
|
6 |
"generated_by" : "Module::Build version 0.38, CPAN::Meta::Converter version 2.112150",
|
|
7 |
"license" : [
|
|
8 |
"perl_5"
|
|
9 |
],
|
|
10 |
"meta-spec" : {
|
|
11 |
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
|
|
12 |
"version" : "2"
|
|
13 |
},
|
|
14 |
"name" : "DateTime-Format-ISO8601",
|
|
15 |
"prereqs" : {
|
|
16 |
"configure" : {
|
|
17 |
"requires" : {
|
|
18 |
"Module::Build" : "0.38"
|
|
19 |
}
|
|
20 |
},
|
|
21 |
"runtime" : {
|
|
22 |
"recommends" : {
|
|
23 |
"File::Find::Rule" : "0.24",
|
|
24 |
"Test::Distribution" : "1.22",
|
|
25 |
"Test::Pod" : "0.95"
|
|
26 |
},
|
|
27 |
"requires" : {
|
|
28 |
"DateTime" : "0.18",
|
|
29 |
"DateTime::Format::Builder" : "0.77"
|
|
30 |
}
|
|
31 |
}
|
|
32 |
},
|
|
33 |
"provides" : {
|
|
34 |
"DateTime::Format::ISO8601" : {
|
|
35 |
"file" : "lib/DateTime/Format/ISO8601.pm",
|
|
36 |
"version" : "0.08"
|
|
37 |
}
|
|
38 |
},
|
|
39 |
"release_status" : "stable",
|
|
40 |
"resources" : {
|
|
41 |
"license" : [
|
|
42 |
"http://dev.perl.org/licenses/"
|
|
43 |
]
|
|
44 |
},
|
|
45 |
"version" : "0.08"
|
|
46 |
}
|
0 | 0 |
---
|
1 | |
name: DateTime-Format-ISO8601
|
2 | |
version: 0.07
|
|
1 |
abstract: 'Parses ISO8601 formats'
|
3 | 2 |
author:
|
4 | 3 |
- 'Joshua Hoblitt <jhoblitt@cpan.org>'
|
5 | |
abstract: Parses ISO8601 formats
|
|
4 |
build_requires: {}
|
|
5 |
configure_requires:
|
|
6 |
Module::Build: 0.38
|
|
7 |
dynamic_config: 1
|
|
8 |
generated_by: 'Module::Build version 0.38, CPAN::Meta::Converter version 2.112150'
|
6 | 9 |
license: perl
|
7 | |
resources:
|
8 | |
license: http://dev.perl.org/licenses/
|
9 | |
requires:
|
10 | |
DateTime: 0.18
|
11 | |
DateTime::Format::Builder: 0.77
|
|
10 |
meta-spec:
|
|
11 |
url: http://module-build.sourceforge.net/META-spec-v1.4.html
|
|
12 |
version: 1.4
|
|
13 |
name: DateTime-Format-ISO8601
|
|
14 |
provides:
|
|
15 |
DateTime::Format::ISO8601:
|
|
16 |
file: lib/DateTime/Format/ISO8601.pm
|
|
17 |
version: 0.08
|
12 | 18 |
recommends:
|
13 | 19 |
File::Find::Rule: 0.24
|
14 | 20 |
Test::Distribution: 1.22
|
15 | 21 |
Test::Pod: 0.95
|
16 | |
configure_requires:
|
17 | |
Module::Build: 0.35
|
18 | |
provides:
|
19 | |
DateTime::Format::ISO8601:
|
20 | |
file: lib/DateTime/Format/ISO8601.pm
|
21 | |
version: 0.07
|
22 | |
generated_by: Module::Build version 0.35
|
23 | |
meta-spec:
|
24 | |
url: http://module-build.sourceforge.net/META-spec-v1.4.html
|
25 | |
version: 1.4
|
|
22 |
requires:
|
|
23 |
DateTime: 0.18
|
|
24 |
DateTime::Format::Builder: 0.77
|
|
25 |
resources:
|
|
26 |
license: http://dev.perl.org/licenses/
|
|
27 |
version: 0.08
|
0 | |
# Note: this file was auto-generated by Module::Build::Compat version 0.35
|
1 | |
|
|
0 |
# Note: this file was auto-generated by Module::Build::Compat version 0.3800
|
|
1 |
|
2 | 2 |
unless (eval "use Module::Build::Compat 0.02; 1" ) {
|
3 | 3 |
print "This module requires Module::Build to install itself.\n";
|
4 | |
|
|
4 |
|
5 | 5 |
require ExtUtils::MakeMaker;
|
6 | 6 |
my $yn = ExtUtils::MakeMaker::prompt
|
7 | 7 |
(' Install Module::Build now from CPAN?', 'y');
|
8 | |
|
|
8 |
|
9 | 9 |
unless ($yn =~ /^y/i) {
|
10 | 10 |
die " *** Cannot install without Module::Build. Exiting ...\n";
|
11 | 11 |
}
|
12 | |
|
|
12 |
|
13 | 13 |
require Cwd;
|
14 | 14 |
require File::Spec;
|
15 | 15 |
require CPAN;
|
16 | |
|
|
16 |
|
17 | 17 |
# Save this 'cause CPAN will chdir all over the place.
|
18 | 18 |
my $cwd = Cwd::cwd();
|
19 | |
|
|
19 |
|
20 | 20 |
CPAN::Shell->install('Module::Build::Compat');
|
21 | 21 |
CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
|
22 | 22 |
or die "Couldn't install Module::Build, giving up.\n";
|
23 | |
|
|
23 |
|
24 | 24 |
chdir $cwd or die "Cannot chdir() back to $cwd: $!";
|
25 | 25 |
}
|
26 | 26 |
eval "use Module::Build::Compat 0.02; 1" or die $@;
|
27 | 27 |
|
28 | 28 |
Module::Build::Compat->run_build_pl(args => \@ARGV);
|
29 | |
my $build_script = 'Build';
|
|
29 |
my $build_script = 'Build';
|
30 | 30 |
$build_script .= '.com' if $^O eq 'VMS';
|
31 | 31 |
exit(0) unless(-e $build_script); # cpantesters convention
|
32 | 32 |
require Module::Build;
|
0 | 0 |
# Copyright (C) 2003-2005 Joshua Hoblitt
|
1 | |
#
|
2 | |
# $Id: ISO8601.pm,v 1.25 2010/01/18 06:36:21 jhoblitt Exp $
|
3 | 1 |
|
4 | 2 |
package DateTime::Format::ISO8601;
|
5 | 3 |
|
|
7 | 5 |
use warnings;
|
8 | 6 |
|
9 | 7 |
use vars qw( $VERSION );
|
10 | |
$VERSION = '0.07';
|
|
8 |
$VERSION = '0.08';
|
11 | 9 |
|
12 | 10 |
use Carp qw( croak );
|
13 | 11 |
use DateTime;
|
|
676 | 674 |
},
|
677 | 675 |
{
|
678 | 676 |
#YYYYMMDDThhmmss.ss[+-]hhmm 19850412T101530.5+0100 20041020T101530.5-0500
|
|
677 |
regex => qr/^ (\d{4}) (\d\d) (\d\d)
|
|
678 |
T?? (\d\d) (\d\d) (\d\d) [\.,] (\d+)
|
|
679 |
([+-] \d\d \d\d) $/x,
|
|
680 |
params => [ qw( year month day hour minute second nanosecond time_zone ) ],
|
|
681 |
postprocess => [
|
|
682 |
\&_fractional_second,
|
|
683 |
\&_normalize_offset,
|
|
684 |
],
|
|
685 |
},
|
|
686 |
{
|
679 | 687 |
#YYYY-MM-DDThh:mm:ss.ss[+-]hh:mm 1985-04-12T10:15:30.5+01:00 1985-04-12T10:15:30.5-05:00
|
680 | |
regex => qr/^ (\d{4}) -?? (\d\d) -?? (\d\d)
|
681 | |
T?? (\d\d) :?? (\d\d) :?? (\d\d) [\.,] (\d+)
|
682 | |
([+-] \d\d :?? \d\d) $/x,
|
|
688 |
regex => qr/^ (\d{4}) - (\d\d) - (\d\d)
|
|
689 |
T?? (\d\d) : (\d\d) : (\d\d) [\.,] (\d+)
|
|
690 |
([+-] \d\d : \d\d) $/x,
|
683 | 691 |
params => [ qw( year month day hour minute second nanosecond time_zone ) ],
|
684 | 692 |
postprocess => [
|
685 | 693 |
\&_fractional_second,
|
0 | 0 |
#!/usr/bin/env perl
|
1 | 1 |
|
2 | 2 |
# Copyright (C) 2005 Joshua Hoblitt
|
3 | |
#
|
4 | |
# $Id: 00_distribution.t,v 1.1 2007/04/11 01:17:16 jhoblitt Exp $
|
5 | 3 |
|
6 | 4 |
use strict;
|
7 | 5 |
use warnings FATAL => qw( all );
|
0 | 0 |
#!/usr/bin/perl
|
1 | 1 |
|
2 | 2 |
# Copyright (C) 2003-2005 Joshua Hoblitt
|
3 | |
#
|
4 | |
# $Id: 01_load.t,v 1.5 2007/04/11 01:11:42 jhoblitt Exp $
|
5 | 3 |
|
6 | 4 |
use strict;
|
7 | 5 |
use warnings;
|
0 | 0 |
#!/usr/bin/perl
|
1 | 1 |
|
2 | 2 |
# Copyright (C) 2003-2005 Joshua Hoblitt
|
3 | |
#
|
4 | |
# $Id: 02_examples.t,v 1.11 2010/01/18 06:36:23 jhoblitt Exp $
|
5 | 3 |
|
6 | 4 |
use strict;
|
7 | 5 |
use warnings;
|
0 | 0 |
#!/usr/bin/perl
|
1 | 1 |
|
2 | 2 |
# Copyright (C) 2005 Joshua Hoblitt
|
3 | |
#
|
4 | |
# $Id: 03_base_datetime.t,v 1.4 2007/04/11 01:11:42 jhoblitt Exp $
|
5 | 3 |
|
6 | 4 |
use strict;
|
7 | 5 |
use warnings;
|
0 | 0 |
#!/usr/bin/perl
|
1 | 1 |
|
2 | 2 |
# Copyright (C) 2005 Joshua Hoblitt
|
3 | |
#
|
4 | |
# $Id: 04_legacy_year.t,v 1.3 2007/04/11 01:11:42 jhoblitt Exp $
|
5 | 3 |
|
6 | 4 |
use strict;
|
7 | 5 |
use warnings;
|
0 | 0 |
#!/usr/bin/perl
|
1 | 1 |
|
2 | 2 |
# Copyright (C) 2005 Joshua Hoblitt
|
3 | |
#
|
4 | |
# $Id: 05_cut_off_year.t,v 1.3 2007/04/11 01:11:42 jhoblitt Exp $
|
5 | 3 |
|
6 | 4 |
use strict;
|
7 | 5 |
use warnings;
|
|
0 |
#!/usr/bin/perl
|
|
1 |
|
|
2 |
# Copyright (C) 2003-2012 Joshua Hoblitt
|
|
3 |
|
|
4 |
use strict;
|
|
5 |
use warnings;
|
|
6 |
|
|
7 |
use lib qw( ./lib );
|
|
8 |
|
|
9 |
use Test::More tests => 4;
|
|
10 |
|
|
11 |
use DateTime::Format::ISO8601;
|
|
12 |
|
|
13 |
# parse_datetime
|
|
14 |
my $base_year = 2000;
|
|
15 |
my $base_month = "01";
|
|
16 |
my $iso8601 = DateTime::Format::ISO8601->new(
|
|
17 |
base_datetime => DateTime->new( year => $base_year, month => $base_month ),
|
|
18 |
);
|
|
19 |
|
|
20 |
# examples from https://rt.cpan.org/Ticket/Update.html?id=5264
|
|
21 |
|
|
22 |
#Section 4.2.5.1 says "Expressions of the difference between local time and UTC
|
|
23 |
#of day are a component in the representations defined in 4.2.5.2; they shall
|
|
24 |
#not be used as self-standing expressions.". Which means the UTC offset is
|
|
25 |
#considered part of the time format so you get to use the extended formation
|
|
26 |
#(the ':') or not but you can't mix and match the two.
|
|
27 |
|
|
28 |
eval {
|
|
29 |
my $dt = $iso8601->parse_datetime( '2009-12-10T09:00:00.00+0100' );
|
|
30 |
};
|
|
31 |
like( $@, qr/Invalid date format/ );
|
|
32 |
|
|
33 |
eval {
|
|
34 |
my $dt = $iso8601->parse_datetime( '2011-07-04T20:50:23+0200' );
|
|
35 |
};
|
|
36 |
like( $@, qr/Invalid date format/ );
|
|
37 |
|
|
38 |
# more "colon or not" coverage
|
|
39 |
eval {
|
|
40 |
my $dt = $iso8601->parse_datetime( '20091210T090000.00+01:00' );
|
|
41 |
};
|
|
42 |
like( $@, qr/Invalid date format/ );
|
|
43 |
|
|
44 |
eval {
|
|
45 |
my $dt = $iso8601->parse_datetime( '20110704T205023+02:00' );
|
|
46 |
};
|
|
47 |
like( $@, qr/Invalid date format/ );
|