Hello community, here is the log from the commit of package perl-DateTime for openSUSE:Factory checked in at 2014-03-09 18:37:37 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-DateTime (Old) and /work/SRC/openSUSE:Factory/.perl-DateTime.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-DateTime" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-DateTime/perl-DateTime.changes 2014-02-11 15:24:36.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.perl-DateTime.new/perl-DateTime.changes 2014-03-09 18:37:38.000000000 +0100 @@ -1,0 +2,14 @@ +Fri Mar 7 09:10:06 UTC 2014 - [email protected] + +- updated to 1.07 + - Added a hack to get this module working on Android. RT #92671. + - DateTime's attempt to generate infinity by calculating 9**9**9 actually got + a number on some platforms, like powerpcspe. Reported by Gregor Hermann. RT + #91696. + - Added a new CLDR ZZZZZ specifier, which is like ZZZ but inserts a + colon. Patch by Ricardo Signes. + - Added a new option for the truncate() method to truncate to the + "local_week". This truncates to the locale's notion of the first day of the + week, rather than always truncating to Monday. Patch by Christian Hansen. + +------------------------------------------------------------------- Old: ---- DateTime-1.04.tar.gz New: ---- DateTime-1.07.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-DateTime.spec ++++++ --- /var/tmp/diff_new_pack.KIFufD/_old 2014-03-09 18:37:39.000000000 +0100 +++ /var/tmp/diff_new_pack.KIFufD/_new 2014-03-09 18:37:39.000000000 +0100 @@ -17,7 +17,7 @@ Name: perl-DateTime -Version: 1.04 +Version: 1.07 Release: 0 %define cpan_name DateTime Summary: A date and time object @@ -35,17 +35,6 @@ BuildRequires: perl(Test::Fatal) BuildRequires: perl(Test::More) >= 0.88 BuildRequires: perl(Try::Tiny) -#BuildRequires: perl(autodie) -#BuildRequires: perl(DateTime) -#BuildRequires: perl(DateTime::Duration) -#BuildRequires: perl(DateTime::Helpers) -#BuildRequires: perl(DateTime::Infinite) -#BuildRequires: perl(DateTime::LeapSecond) -#BuildRequires: perl(DateTimePP) -#BuildRequires: perl(DateTimePPExtra) -#BuildRequires: perl(Dist::Zilla::Plugin::ModuleBuild::XSOrPP) -#BuildRequires: perl(Moose) -#BuildRequires: perl(Test::DependentModules) Requires: perl(DateTime::Locale) >= 0.41 Requires: perl(DateTime::TimeZone) >= 1.09 Requires: perl(Params::Validate) >= 0.76 ++++++ DateTime-1.04.tar.gz -> DateTime-1.07.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/Build.PL new/DateTime-1.07/Build.PL --- old/DateTime-1.04/Build.PL 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/Build.PL 2014-02-07 03:35:20.000000000 +0100 @@ -1,4 +1,5 @@ +# This file was automatically generated by inc::MyModuleBuild v(dev). use strict; use warnings; @@ -18,7 +19,7 @@ "Dave Rolsky <autarch\@urth.org>" ], "dist_name" => "DateTime", - "dist_version" => "1.04", + "dist_version" => "1.07", "license" => "artistic_2", "module_name" => "DateTime", "recommends" => {}, @@ -51,17 +52,18 @@ ); +my %fallback_build_requires = ( + "Module::Build" => "0.3601", + "Storable" => 0, + "Test::Fatal" => 0, + "Test::More" => "0.88", + "utf8" => 0 +); + + unless ( eval { Module::Build->VERSION(0.4004) } ) { - my $tr = delete $module_build_args{test_requires}; - my $br = $module_build_args{build_requires}; - for my $mod ( keys %$tr ) { - if ( exists $br->{$mod} ) { - $br->{$mod} = $tr->{$mod} if $tr->{$mod} > $br->{$mod}; - } - else { - $br->{$mod} = $tr->{$mod}; - } - } + delete $module_build_args{test_requires}; + $module_build_args{build_requires} = \%fallback_build_requires; } my $build = Module::Build->new(%module_build_args); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/Changes new/DateTime-1.07/Changes --- old/DateTime-1.04/Changes 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/Changes 2014-02-07 03:35:20.000000000 +0100 @@ -1,3 +1,25 @@ +1.07 2014-02-06 + +- Added a hack to get this module working on Android. RT #92671. + + +1.06 2013-12-31 + +- DateTime's attempt to generate infinity by calculating 9**9**9 actually got + a number on some platforms, like powerpcspe. Reported by Gregor Hermann. RT + #91696. + + +1.05 2013-12-22 + +- Added a new CLDR ZZZZZ specifier, which is like ZZZ but inserts a + colon. Patch by Ricardo Signes. + +- Added a new option for the truncate() method to truncate to the + "local_week". This truncates to the locale's notion of the first day of the + week, rather than always truncating to Monday. Patch by Christian Hansen. + + 1.04 2013-12-07 - Calling set_locale() or set_formatter() on an object with an ambiguous local diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/LICENSE new/DateTime-1.07/LICENSE --- old/DateTime-1.04/LICENSE 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/LICENSE 2014-02-07 03:35:20.000000000 +0100 @@ -1,4 +1,4 @@ -This software is Copyright (c) 2013 by Dave Rolsky. +This software is Copyright (c) 2014 by Dave Rolsky. This is free software, licensed under: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/MANIFEST new/DateTime-1.07/MANIFEST --- old/DateTime-1.04/MANIFEST 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/MANIFEST 2014-02-07 03:35:20.000000000 +0100 @@ -1,3 +1,4 @@ +# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.012. Build.PL CREDITS Changes @@ -8,15 +9,6 @@ META.yml README TODO -_build/auto_features -_build/build_params -_build/cleanup -_build/config_data -_build/features -_build/magicnum -_build/notes -_build/prereqs -_build/runtime_params c/leap_seconds.h c/ppport.h dist.ini diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/META.json new/DateTime-1.07/META.json --- old/DateTime-1.04/META.json 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/META.json 2014-02-07 03:35:20.000000000 +0100 @@ -4,7 +4,7 @@ "Dave Rolsky <[email protected]>" ], "dynamic_config" : 0, - "generated_by" : "Dist::Zilla version 4.300039, CPAN::Meta::Converter version 2.131560", + "generated_by" : "Dist::Zilla version 5.012, CPAN::Meta::Converter version 2.131560", "license" : [ "artistic_2" ], @@ -27,6 +27,8 @@ "develop" : { "requires" : { "Test::CPAN::Changes" : "0.19", + "Test::More" : "0", + "Test::NoTabs" : "0", "Test::Pod" : "1.41" } }, @@ -71,6 +73,7 @@ "web" : "http://git.urth.org/DateTime.pm.git" } }, - "version" : "1.04" + "version" : "1.07", + "x_authority" : "cpan:DROLSKY" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/META.yml new/DateTime-1.07/META.yml --- old/DateTime-1.04/META.yml 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/META.yml 2014-02-07 03:35:20.000000000 +0100 @@ -11,7 +11,7 @@ configure_requires: Module::Build: 0.3601 dynamic_config: 0 -generated_by: 'Dist::Zilla version 4.300039, CPAN::Meta::Converter version 2.131560' +generated_by: 'Dist::Zilla version 5.012, CPAN::Meta::Converter version 2.131560' license: artistic_2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -37,4 +37,5 @@ resources: bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=DateTime repository: git://git.urth.org/DateTime.pm.git -version: 1.04 +version: 1.07 +x_authority: cpan:DROLSKY diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/README new/DateTime-1.07/README --- old/DateTime-1.04/README 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/README 2014-02-07 03:35:20.000000000 +0100 @@ -1,14 +1,16 @@ This archive contains the distribution DateTime, -version 1.04: +version 1.07: A date and time object -This software is Copyright (c) 2013 by Dave Rolsky. +This software is Copyright (c) 2014 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) +This README file was generated by Dist::Zilla::Plugin::Readme v5.012. + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/_build/auto_features new/DateTime-1.07/_build/auto_features --- old/DateTime-1.04/_build/auto_features 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/_build/auto_features 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -do{ my $x = {}; -$x; } \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/_build/build_params new/DateTime-1.07/_build/build_params --- old/DateTime-1.04/_build/build_params 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/_build/build_params 1970-01-01 01:00:00.000000000 +0100 @@ -1,123 +0,0 @@ -do{ my $x = [ - { - 'ARGV' => [] - }, - {}, - { - 'verbose' => undef, - 'dist_suffix' => undef, - 'PL_files' => undef, - 'pollute' => undef, - 'metafile2' => 'META.json', - 'bindoc_dirs' => [ - 'blib/script' - ], - 'conflicts' => {}, - 'scripts' => undef, - 'recommends' => {}, - 'pod_files' => undef, - 'config_dir' => '_build', - 'dist_version' => 42, - 'sign' => undef, - 'recurse_into' => [], - 'build_bat' => 0, - 'extra_linker_flags' => [], - 'build_class' => 'Module::Build', - 'prereq_action_types' => [ - 'requires', - 'build_requires', - 'test_requires', - 'conflicts', - 'recommends' - ], - 'base_dir' => '/home/autarch/projects/DateTime.pm', - 'allow_mb_mismatch' => 0, - 'xs_files' => undef, - 'destdir' => undef, - 'metafile' => 'META.yml', - 'mb_version' => '0.4005', - 'use_tap_harness' => 0, - 'test_file_exts' => [ - '.t' - ], - 'dist_name' => 'DateTime', - 'has_config_data' => undef, - 'install_base' => undef, - 'module_name' => 'DateTime', - '_have_c_compiler' => 1, - 'recursive_test_files' => 1, - 'perl' => '/home/autarch/perl5/perlbrew/perls/perl-5.16.3/bin/perl', - 'libdoc_dirs' => [ - 'blib/lib', - 'blib/arch' - ], - 'dist_author' => undef, - 'bundle_inc' => [], - 'use_rcfile' => 1, - 'configure_requires' => {}, - 'pureperl_only' => 0, - 'test_files' => undef, - 'dist_abstract' => 'Whatever', - 'create_readme' => undef, - 'prefix_relpaths' => {}, - 'share_dir' => undef, - 'debug' => undef, - 'meta_merge' => {}, - 'get_options' => {}, - 'dist_version_from' => undef, - '_added_to_INC' => [], - 'auto_configure_requires' => 1, - 'create_license' => undef, - 'debugger' => undef, - 'html_css' => '', - 'cpan_client' => 'cpan', - 'mymetafile2' => 'MYMETA.json', - 'bundle_inc_preload' => [], - 'build_elements' => [ - 'PL', - 'support', - 'pm', - 'xs', - 'share_dir', - 'pod', - 'script' - ], - 'release_status' => 'stable', - 'needs_compiler' => 1, - 'orig_dir' => '/home/autarch/projects/DateTime.pm', - 'include_dirs' => [], - 'test_requires' => {}, - 'installdirs' => 'site', - 'mymetafile' => 'MYMETA.yml', - 'create_makefile_pl' => undef, - 'magic_number' => undef, - 'dynamic_config' => 1, - 'tap_harness_args' => {}, - 'install_sets' => {}, - 'install_base_relpaths' => {}, - 'create_packlist' => 1, - 'meta_add' => {}, - 'requires' => {}, - 'install_path' => {}, - 'pm_files' => undef, - 'quiet' => undef, - 'script_files' => undef, - 'extra_compiler_flags' => [ - '-Wall' - ], - 'build_script' => 'Build', - 'original_prefix' => {}, - 'c_source' => 'c', - 'program_name' => undef, - 'autosplit' => undef, - 'license' => 'artistic_2', - 'build_requires' => { - 'ExtUtils::CBuilder' => 0 - }, - 'allow_pureperl' => 0, - 'config' => undef, - 'blib' => 'blib', - 'prefix' => undef - } -]; -$x; } \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/_build/cleanup new/DateTime-1.07/_build/cleanup --- old/DateTime-1.04/_build/cleanup 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/_build/cleanup 1970-01-01 01:00:00.000000000 +0100 @@ -1,8 +0,0 @@ -do{ my $x = { - 'lib/DateTime.o' => 1, - 'blib/arch/auto/DateTime/DateTime.bs' => 1, - 'blib/arch/auto/DateTime/DateTime.so' => 1, - 'lib/DateTime.c' => 1, - 'blib' => 1 -}; -$x; } \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/_build/config_data new/DateTime-1.07/_build/config_data --- old/DateTime-1.04/_build/config_data 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/_build/config_data 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -do{ my $x = {}; -$x; } \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/_build/features new/DateTime-1.07/_build/features --- old/DateTime-1.04/_build/features 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/_build/features 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -do{ my $x = {}; -$x; } \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/_build/magicnum new/DateTime-1.07/_build/magicnum --- old/DateTime-1.04/_build/magicnum 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/_build/magicnum 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -731030 \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/_build/notes new/DateTime-1.07/_build/notes --- old/DateTime-1.04/_build/notes 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/_build/notes 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -do{ my $x = {}; -$x; } \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/_build/prereqs new/DateTime-1.07/_build/prereqs --- old/DateTime-1.04/_build/prereqs 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/_build/prereqs 1970-01-01 01:00:00.000000000 +0100 @@ -1,10 +0,0 @@ -do{ my $x = { - 'build_requires' => { - 'ExtUtils::CBuilder' => 0 - }, - 'test_requires' => {}, - 'conflicts' => {}, - 'requires' => {}, - 'recommends' => {} -}; -$x; } \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/_build/runtime_params new/DateTime-1.07/_build/runtime_params --- old/DateTime-1.04/_build/runtime_params 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/_build/runtime_params 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -do{ my $x = {}; -$x; } \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/dist.ini new/DateTime-1.07/dist.ini --- old/DateTime-1.04/dist.ini 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/dist.ini 2014-02-07 03:35:20.000000000 +0100 @@ -3,7 +3,7 @@ license = Artistic_2_0 copyright_holder = Dave Rolsky -version = 1.04 +version = 1.07 [NextRelease] format = %-6v %{yyyy-MM-dd}d @@ -35,6 +35,9 @@ [SurgicalPodWeaver] +[Authority] +do_munging = 0 + [EOLTests] [NoTabsTests] [PodSyntaxTests] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/lib/DateTime/Duration.pm new/DateTime-1.07/lib/DateTime/Duration.pm --- old/DateTime-1.04/lib/DateTime/Duration.pm 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/lib/DateTime/Duration.pm 2014-02-07 03:35:20.000000000 +0100 @@ -1,8 +1,5 @@ package DateTime::Duration; -{ - $DateTime::Duration::VERSION = '1.04'; -} - +$DateTime::Duration::VERSION = '1.07'; use strict; use warnings; @@ -318,7 +315,7 @@ =head1 VERSION -version 1.04 +version 1.07 =head1 SYNOPSIS @@ -602,7 +599,7 @@ =head1 COPYRIGHT AND LICENSE -This software is Copyright (c) 2013 by Dave Rolsky. +This software is Copyright (c) 2014 by Dave Rolsky. This is free software, licensed under: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/lib/DateTime/Helpers.pm new/DateTime-1.07/lib/DateTime/Helpers.pm --- old/DateTime-1.04/lib/DateTime/Helpers.pm 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/lib/DateTime/Helpers.pm 2014-02-07 03:35:20.000000000 +0100 @@ -1,8 +1,5 @@ package DateTime::Helpers; -{ - $DateTime::Helpers::VERSION = '1.04'; -} - +$DateTime::Helpers::VERSION = '1.07'; use strict; use warnings; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/lib/DateTime/Infinite.pm new/DateTime-1.07/lib/DateTime/Infinite.pm --- old/DateTime-1.04/lib/DateTime/Infinite.pm 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/lib/DateTime/Infinite.pm 2014-02-07 03:35:20.000000000 +0100 @@ -1,8 +1,5 @@ package DateTime::Infinite; -{ - $DateTime::Infinite::VERSION = '1.04'; -} - +$DateTime::Infinite::VERSION = '1.07'; use strict; use warnings; @@ -37,10 +34,7 @@ sub STORABLE_thaw {return} package DateTime::Infinite::Future; -{ - $DateTime::Infinite::Future::VERSION = '1.04'; -} - +$DateTime::Infinite::Future::VERSION = '1.07'; use strict; use warnings; @@ -65,10 +59,7 @@ } package DateTime::Infinite::Past; -{ - $DateTime::Infinite::Past::VERSION = '1.04'; -} - +$DateTime::Infinite::Past::VERSION = '1.07'; use strict; use warnings; @@ -178,7 +169,7 @@ =head1 VERSION -version 1.04 +version 1.07 =head1 SYNOPSIS @@ -230,7 +221,7 @@ =head1 COPYRIGHT AND LICENSE -This software is Copyright (c) 2013 by Dave Rolsky. +This software is Copyright (c) 2014 by Dave Rolsky. This is free software, licensed under: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/lib/DateTime/LeapSecond.pm new/DateTime-1.07/lib/DateTime/LeapSecond.pm --- old/DateTime-1.04/lib/DateTime/LeapSecond.pm 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/lib/DateTime/LeapSecond.pm 2014-02-07 03:35:20.000000000 +0100 @@ -1,8 +1,5 @@ package DateTime::LeapSecond; -{ - $DateTime::LeapSecond::VERSION = '1.04'; -} - +$DateTime::LeapSecond::VERSION = '1.07'; use strict; use warnings; @@ -131,7 +128,7 @@ =head1 VERSION -version 1.04 +version 1.07 =head1 SYNOPSIS @@ -184,7 +181,7 @@ =head1 COPYRIGHT AND LICENSE -This software is Copyright (c) 2013 by Dave Rolsky. +This software is Copyright (c) 2014 by Dave Rolsky. This is free software, licensed under: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/lib/DateTime.pm new/DateTime-1.07/lib/DateTime.pm --- old/DateTime-1.04/lib/DateTime.pm 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/lib/DateTime.pm 2014-02-07 03:35:20.000000000 +0100 @@ -1,8 +1,5 @@ package DateTime; -{ - $DateTime::VERSION = '1.04'; -} - +$DateTime::VERSION = '1.07'; use 5.008001; use strict; @@ -72,8 +69,8 @@ use constant MAX_NANOSECONDS => 1_000_000_000; # 1E9 = almost 32 bits -use constant INFINITY => ( 9**9**9 ); -use constant NEG_INFINITY => -1 * ( 9**9**9 ); +use constant INFINITY => ( 100**100**100**100 ); +use constant NEG_INFINITY => -1 * ( 100**100**100**100 ); use constant NAN => INFINITY - INFINITY; use constant SECONDS_PER_DAY => 86400; @@ -201,7 +198,7 @@ "Invalid day of month (day = $p{day} - month = $p{month} - year = $p{year})\n" ) if $p{day} > 28 - && $p{day} > $class->_month_length( $p{year}, $p{month} ); + && $p{day} > $class->_month_length( $p{year}, $p{month} ); return $class->_new(%p); } @@ -245,8 +242,10 @@ $self->{rd_nanosecs} = $p{nanosecond}; $self->{formatter} = $p{formatter}; - $self->_normalize_nanoseconds( $self->{local_rd_secs}, - $self->{rd_nanosecs} ); + $self->_normalize_nanoseconds( + $self->{local_rd_secs}, + $self->{rd_nanosecs} + ); # Set this explicitly since it can't be calculated accurately # without knowing our time zone offset, and it's possible that the @@ -398,8 +397,10 @@ # We account for leap seconds in the new() method and nowhere else # except date math. - $self->_normalize_tai_seconds( $self->{utc_rd_days}, - $self->{utc_rd_secs} ); + $self->_normalize_tai_seconds( + $self->{utc_rd_days}, + $self->{utc_rd_secs} + ); } sub _normalize_seconds { @@ -408,12 +409,16 @@ return if $self->{utc_rd_secs} >= 0 && $self->{utc_rd_secs} <= 86399; if ( $self->{tz}->is_floating ) { - $self->_normalize_tai_seconds( $self->{utc_rd_days}, - $self->{utc_rd_secs} ); + $self->_normalize_tai_seconds( + $self->{utc_rd_days}, + $self->{utc_rd_secs} + ); } else { - $self->_normalize_leap_seconds( $self->{utc_rd_days}, - $self->{utc_rd_secs} ); + $self->_normalize_leap_seconds( + $self->{utc_rd_days}, + $self->{utc_rd_secs} + ); } } @@ -435,8 +440,10 @@ $self->{local_rd_secs} = $self->{utc_rd_secs} + $offset; # intentionally ignore leap seconds here - $self->_normalize_tai_seconds( $self->{local_rd_days}, - $self->{local_rd_secs} ); + $self->_normalize_tai_seconds( + $self->{local_rd_days}, + $self->{local_rd_secs} + ); $self->{local_rd_secs} += $self->{offset_modifier}; } @@ -454,8 +461,10 @@ = $self->_rd2ymd( $self->{local_rd_days}, 1 ); @{ $self->{local_c} }{qw( hour minute second )} - = $self->_seconds_as_components( $self->{local_rd_secs}, - $self->{utc_rd_secs}, $self->{offset_modifier} ); + = $self->_seconds_as_components( + $self->{local_rd_secs}, + $self->{utc_rd_secs}, $self->{offset_modifier} + ); } sub _calc_utc_components { @@ -504,6 +513,7 @@ my %p = validate( @_, $spec ); my %args; + # Epoch may come from Time::HiRes, so it may not be an integer. my ( $int, $dec ) = $p{epoch} =~ /^(-?\d+)?(\.\d+)?/; $int ||= 0; @@ -743,14 +753,8 @@ sub local_day_of_week { my $self = shift; - - my $day = $self->day_of_week(); - - my $local_first_day = $self->{locale}->first_day_of_week(); - - my $d = ( ( 8 - $local_first_day ) + $day ) % 7; - - return $d == 0 ? 7 : $d; + return 1 + + ( $self->day_of_week - $self->{locale}->first_day_of_week ) % 7; } sub day_name { $_[0]->{locale}->day_format_wide->[ $_[0]->day_of_week_0() ] } @@ -916,7 +920,7 @@ my $dow = $self->_ymd2rd( $year, 1, 1 ) % 7; - # Tears starting with a Thursday and leap years starting with a Wednesday + # Years starting with a Thursday and leap years starting with a Wednesday # have 53 weeks. return ( $dow == 4 || ( $dow == 3 && $self->_is_leap_year($year) ) ) ? 53 @@ -1013,7 +1017,7 @@ 'l' => sub { sprintf( '%2d', $_[0]->hour_12 ) }, 'm' => sub { sprintf( '%02d', $_[0]->month ) }, 'M' => sub { sprintf( '%02d', $_[0]->minute ) }, - 'n' => sub {"\n"}, # should this be OS-sensitive? + 'n' => sub { "\n" }, # should this be OS-sensitive? 'N' => \&_format_nanosecs, 'p' => sub { $_[0]->am_or_pm() }, 'P' => sub { lc $_[0]->am_or_pm() }, @@ -1021,7 +1025,7 @@ 'R' => sub { $_[0]->strftime('%H:%M') }, 's' => sub { $_[0]->epoch }, 'S' => sub { sprintf( '%02d', $_[0]->second ) }, - 't' => sub {"\t"}, + 't' => sub { "\t" }, 'T' => sub { $_[0]->strftime('%H:%M:%S') }, 'u' => sub { $_[0]->day_of_week }, 'U' => sub { @@ -1047,7 +1051,7 @@ 'Y' => sub { return $_[0]->year }, 'z' => sub { DateTime::TimeZone->offset_as_string( $_[0]->offset ) }, 'Z' => sub { $_[0]->{tz}->short_name_for_datetime( $_[0] ) }, - '%' => sub {'%'}, + '%' => sub { '%' }, ); $strftime_patterns{h} = $strftime_patterns{b}; @@ -1219,8 +1223,10 @@ # spec is not all that clear. qr/(S+)/ => sub { my $l = length $1; - my $val = sprintf( "%.${l}f", - $_[0]->fractional_second() - $_[0]->second() ); + my $val = sprintf( + "%.${l}f", + $_[0]->fractional_second() - $_[0]->second() + ); $val =~ s/^0\.//; $val || 0; }, @@ -1229,7 +1235,15 @@ qr/zzzz/ => sub { $_[0]->time_zone_long_name() }, qr/z{1,3}/ => sub { $_[0]->time_zone_short_name() }, - qr/ZZZZ/ => sub { + qr/ZZZZZ/ => sub { + substr( + my $z + = DateTime::TimeZone->offset_as_string( $_[0]->offset() ), + -2, 0, ":" + ); + $z; + }, + qr/ZZZZ/ => sub { $_[0]->time_zone_short_name() . DateTime::TimeZone->offset_as_string( $_[0]->offset() ); }, @@ -1300,7 +1314,7 @@ my $self = shift; my $pattern = shift; - for ( my $i = 0; $i < @patterns; $i += 2 ) { + for ( my $i = 0 ; $i < @patterns ; $i += 2 ) { if ( $pattern =~ /$patterns[$i]/ ) { my $sub = $patterns[ $i + 1 ]; @@ -1347,8 +1361,8 @@ return $epoch + $nano; } -sub is_finite {1} -sub is_infinite {0} +sub is_finite { 1 } +sub is_infinite { 0 } # added for benefit of DateTime::TimeZone sub utc_year { $_[0]->{utc_year} } @@ -1746,8 +1760,10 @@ $self->{utc_rd_secs} += $deltas{minutes} * 60; # This intentionally ignores leap seconds - $self->_normalize_tai_seconds( $self->{utc_rd_days}, - $self->{utc_rd_secs} ); + $self->_normalize_tai_seconds( + $self->{utc_rd_days}, + $self->{utc_rd_secs} + ); } if ( $deltas{seconds} || $deltas{nanoseconds} ) { @@ -1755,8 +1771,10 @@ if ( $deltas{nanoseconds} ) { $self->{rd_nanosecs} += $deltas{nanoseconds}; - $self->_normalize_nanoseconds( $self->{utc_rd_secs}, - $self->{rd_nanosecs} ); + $self->_normalize_nanoseconds( + $self->{utc_rd_secs}, + $self->{rd_nanosecs} + ); } $self->_normalize_seconds; @@ -1946,7 +1964,7 @@ second => 0, nanosecond => 0, ); - my $re = join '|', 'year', 'week', + my $re = join '|', 'year', 'week', 'local_week', grep { $_ ne 'nanosecond' } keys %TruncateDefault; my $spec = { to => { regex => qr/^(?:$re)$/ } }; @@ -1955,8 +1973,13 @@ my %p = validate( @_, $spec ); my %new; - if ( $p{to} eq 'week' ) { - my $day_diff = $self->day_of_week - 1; + if ( $p{to} eq 'week' || $p{to} eq 'local_week' ) { + my $first_day_of_week + = ( $p{to} eq 'local_week' ) + ? $self->{locale}->first_day_of_week + : 1; + + my $day_diff = ( $self->day_of_week - $first_day_of_week ) % 7; if ($day_diff) { $self->add( days => -1 * $day_diff ); @@ -1985,7 +2008,8 @@ sub set_time_zone { my ( $self, $tz ) = @_; - if (ref $tz) { + if ( ref $tz ) { + # This is a bit of a hack but it works because time zone objects # are singletons, and if it doesn't work all we lose is a little # bit of speed. @@ -2095,7 +2119,7 @@ return $self; } -package +package # hide from PAUSE DateTime::_Thawed; sub utc_rd_values { @{ $_[0]->{utc_vals} } } @@ -2116,7 +2140,7 @@ =head1 VERSION -version 1.04 +version 1.07 =head1 SYNOPSIS @@ -2841,6 +2865,16 @@ This method is provided for compatibility with the C<Time::HiRes> module. +Note that this method suffers from the imprecision of floating point numbers, +and the result may end up rounded to an arbitrary degree depending on your +platform. + + my $dt = DateTime->new( year => 2012, nanosecond => 4 ); + say $dt->hires_repoch(); + +On my system, this simply prints C<1325376000> because adding C<0.000000004> +to C<1325376000> returns C<1325376000>. + =head3 $dt->is_finite(), $dt->is_infinite() These methods allow you to distinguish normal datetime objects from @@ -2937,15 +2971,16 @@ =head3 $dt->truncate( to => ... ) -This method allows you to reset some of the local time components in -the object to their "zero" values. The "to" parameter is used to -specify which values to truncate, and it may be one of "year", -"month", "week", "day", "hour", "minute", or "second". For example, -if "month" is specified, then the local day becomes 1, and the hour, -minute, and second all become 0. - -If "week" is given, then the datetime is set to the beginning of the -week in which it occurs, and the time components are all set to 0. +This method allows you to reset some of the local time components in the +object to their "zero" values. The "to" parameter is used to specify which +values to truncate, and it may be one of "year", "month", "week", "local_week" +"day", "hour", "minute", or "second". For example, if "month" is specified, +then the local day becomes 1, and the hour, minute, and second all become 0. + +If "week" is given, then the datetime is set to the Monday of the week in +which it occurs, and the time components are all set to 0. If you truncate to +"local_week", then the first day of the week is locale-dependent. For example, +in the C<en_US> locale, the first day of the week is Sunday. =head3 $dt->set_time_zone( $tz ) @@ -3873,6 +3908,11 @@ The time zone short name and the offset as one string, so something like "CDT-0500". +=item * ZZZZZ + +The time zone offset as a sexagesimal number, so something like "-05:00". +(This is useful for W3C format.) + =item * v{1,3} The time zone short name. @@ -4206,7 +4246,7 @@ =head1 COPYRIGHT AND LICENSE -This software is Copyright (c) 2013 by Dave Rolsky. +This software is Copyright (c) 2014 by Dave Rolsky. This is free software, licensed under: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/lib/DateTime.xs new/DateTime-1.07/lib/DateTime.xs --- old/DateTime-1.04/lib/DateTime.xs 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/lib/DateTime.xs 2014-02-07 03:35:20.000000000 +0100 @@ -18,13 +18,18 @@ /* This is a temporary hack until a better solution can be found to get the finite() function on Win32 */ #ifndef WIN32 -#include <math.h> -#ifndef isfinite -#ifdef finite -#define finite isfinite -#endif /* ifdef finite */ -#endif /* ifndef isfinite */ -#endif /* ifndef WIN32 */ +# include <math.h> +# ifndef isfinite +# ifdef finite +# define finite isfinite +# endif +# endif +#endif + +/* And another temporary (?) hack for Android. See RT #92671. */ +#ifdef __ANDROID__ +# undef isfinite +#endif /* 2 ** 28 - 307 */ #define RANGE_CUTOFF (268435456 - 307) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/t/16truncate.t new/DateTime-1.07/t/16truncate.t --- old/DateTime-1.04/t/16truncate.t 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/t/16truncate.t 2014-02-07 03:35:20.000000000 +0100 @@ -102,15 +102,19 @@ for ( 1 .. 6 ) { my $trunc = $dt->clone->add( days => $_ )->truncate( to => 'week' ); - is( $trunc->day, 17, - 'truncate to week should always truncate to monday of week' ); + is( + $trunc->day, 17, + 'truncate to week should always truncate to monday of week' + ); } { my $trunc = $dt->clone->add( days => 7 )->truncate( to => 'week' ); - is( $trunc->day, 24, - 'truncate to week should always truncate to monday of week' ); + is( + $trunc->day, 24, + 'truncate to week should always truncate to monday of week' + ); } { @@ -123,6 +127,100 @@ } } +{ + my $dt = DateTime->new( + year => 2013, month => 12, day => 16, + locale => 'fr_FR' + ); + + for ( 1 .. 6 ) { + my $trunc + = $dt->clone->add( days => $_ )->truncate( to => 'local_week' ); + + is( + $trunc->day, 16, + 'truncate to local_week returns correct date - locale start is Monday' + ); + } + + { + my $trunc + = $dt->clone->add( days => 7 )->truncate( to => 'local_week' ); + + is( + $trunc->day, 23, + 'truncate to local_week returns correct date - locale start is Monday' + ); + } + + { + my $dt = DateTime->new( + year => 2013, month => 11, day => 2, + locale => 'fr_FR' + )->truncate( to => 'local_week' ); + + is( + $dt->year, 2013, + 'truncation to local_week across month boundary - locale start is Monday' + ); + is( + $dt->month, 10, + 'truncation to local_week across month boundary - locale start is Monday' + ); + is( + $dt->day, 28, + 'truncation to local_week across month boundary - locale start is Monday' + ); + } +} + +{ + my $dt = DateTime->new( + year => 2013, month => 12, day => 15, + locale => 'en_US' + ); + + for ( 1 .. 6 ) { + my $trunc + = $dt->clone->add( days => $_ )->truncate( to => 'local_week' ); + + is( + $trunc->day, 15, + 'truncate to local_week returns correct date - locale start is Sunday' + ); + } + + { + my $trunc + = $dt->clone->add( days => 7 )->truncate( to => 'local_week' ); + + is( + $trunc->day, 22, + 'truncate to local_week returns correct date - locale start is Sunday' + ); + } + + { + my $dt = DateTime->new( + year => 2013, month => 11, day => 2, + locale => 'en_US' + )->truncate( to => 'local_week' ); + + is( + $dt->year, 2013, + 'truncation to local_week across month boundary - locale start is Sunday' + ); + is( + $dt->month, 10, + 'truncation to local_week across month boundary - locale start is Sunday' + ); + is( + $dt->day, 27, + 'truncation to local_week across month boundary - locale start is Sunday' + ); + } +} + { my $dt = DateTime->new(%vals); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/t/41cldr-format.t new/DateTime-1.07/t/41cldr-format.t --- old/DateTime-1.04/t/41cldr-format.t 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/t/41cldr-format.t 2014-02-07 03:35:20.000000000 +0100 @@ -135,6 +135,7 @@ 'vvv' => 'CDT', 'VVVV' => 'America/Chicago', 'VVV' => 'CDT', + 'ZZZZZ' => '-05:00', q{'one fine day'} => 'one fine day', q{'yy''yy' yyyy} => q{yy'yy 1976}, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/t/release-no-tabs.t new/DateTime-1.07/t/release-no-tabs.t --- old/DateTime-1.04/t/release-no-tabs.t 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/t/release-no-tabs.t 2014-02-07 03:35:20.000000000 +0100 @@ -8,9 +8,21 @@ use strict; use warnings; -use Test::More; -eval 'use Test::NoTabs'; -plan skip_all => 'Test::NoTabs required' if $@; +# this test was generated with Dist::Zilla::Plugin::NoTabsTests 0.06 -all_perl_files_ok(); +use Test::More 0.88; +use Test::NoTabs; + +my @files = ( + 'lib/DateTime.pm', + 'lib/DateTime/Duration.pm', + 'lib/DateTime/Helpers.pm', + 'lib/DateTime/Infinite.pm', + 'lib/DateTime/LeapSecond.pm', + 'lib/DateTimePP.pm', + 'lib/DateTimePPExtra.pm' +); + +notabs_ok($_) foreach @files; +done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/t/release-pod-spell.t new/DateTime-1.07/t/release-pod-spell.t --- old/DateTime-1.04/t/release-pod-spell.t 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/t/release-pod-spell.t 2014-02-07 03:35:20.000000000 +0100 @@ -75,6 +75,7 @@ UTC VVVV ZZZZ +ZZZZZ afterwards bian ccc @@ -104,6 +105,7 @@ proleptic qqq qqqq +sexagesimal subclasses uu vvvv diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/t/release-pod-syntax.t new/DateTime-1.07/t/release-pod-syntax.t --- old/DateTime-1.04/t/release-pod-syntax.t 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/t/release-pod-syntax.t 2014-02-07 03:35:20.000000000 +0100 @@ -7,6 +7,7 @@ } } +# This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use Test::More; eval "use Test::Pod 1.41"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/t/release-pp-16truncate.t new/DateTime-1.07/t/release-pp-16truncate.t --- old/DateTime-1.04/t/release-pp-16truncate.t 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/t/release-pp-16truncate.t 2014-02-07 03:35:20.000000000 +0100 @@ -114,15 +114,19 @@ for ( 1 .. 6 ) { my $trunc = $dt->clone->add( days => $_ )->truncate( to => 'week' ); - is( $trunc->day, 17, - 'truncate to week should always truncate to monday of week' ); + is( + $trunc->day, 17, + 'truncate to week should always truncate to monday of week' + ); } { my $trunc = $dt->clone->add( days => 7 )->truncate( to => 'week' ); - is( $trunc->day, 24, - 'truncate to week should always truncate to monday of week' ); + is( + $trunc->day, 24, + 'truncate to week should always truncate to monday of week' + ); } { @@ -135,6 +139,100 @@ } } +{ + my $dt = DateTime->new( + year => 2013, month => 12, day => 16, + locale => 'fr_FR' + ); + + for ( 1 .. 6 ) { + my $trunc + = $dt->clone->add( days => $_ )->truncate( to => 'local_week' ); + + is( + $trunc->day, 16, + 'truncate to local_week returns correct date - locale start is Monday' + ); + } + + { + my $trunc + = $dt->clone->add( days => 7 )->truncate( to => 'local_week' ); + + is( + $trunc->day, 23, + 'truncate to local_week returns correct date - locale start is Monday' + ); + } + + { + my $dt = DateTime->new( + year => 2013, month => 11, day => 2, + locale => 'fr_FR' + )->truncate( to => 'local_week' ); + + is( + $dt->year, 2013, + 'truncation to local_week across month boundary - locale start is Monday' + ); + is( + $dt->month, 10, + 'truncation to local_week across month boundary - locale start is Monday' + ); + is( + $dt->day, 28, + 'truncation to local_week across month boundary - locale start is Monday' + ); + } +} + +{ + my $dt = DateTime->new( + year => 2013, month => 12, day => 15, + locale => 'en_US' + ); + + for ( 1 .. 6 ) { + my $trunc + = $dt->clone->add( days => $_ )->truncate( to => 'local_week' ); + + is( + $trunc->day, 15, + 'truncate to local_week returns correct date - locale start is Sunday' + ); + } + + { + my $trunc + = $dt->clone->add( days => 7 )->truncate( to => 'local_week' ); + + is( + $trunc->day, 22, + 'truncate to local_week returns correct date - locale start is Sunday' + ); + } + + { + my $dt = DateTime->new( + year => 2013, month => 11, day => 2, + locale => 'en_US' + )->truncate( to => 'local_week' ); + + is( + $dt->year, 2013, + 'truncation to local_week across month boundary - locale start is Sunday' + ); + is( + $dt->month, 10, + 'truncation to local_week across month boundary - locale start is Sunday' + ); + is( + $dt->day, 27, + 'truncation to local_week across month boundary - locale start is Sunday' + ); + } +} + { my $dt = DateTime->new(%vals); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-1.04/t/release-pp-41cldr-format.t new/DateTime-1.07/t/release-pp-41cldr-format.t --- old/DateTime-1.04/t/release-pp-41cldr-format.t 2013-12-07 16:12:44.000000000 +0100 +++ new/DateTime-1.07/t/release-pp-41cldr-format.t 2014-02-07 03:35:20.000000000 +0100 @@ -147,6 +147,7 @@ 'vvv' => 'CDT', 'VVVV' => 'America/Chicago', 'VVV' => 'CDT', + 'ZZZZZ' => '-05:00', q{'one fine day'} => 'one fine day', q{'yy''yy' yyyy} => q{yy'yy 1976}, -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
