Hello community,
here is the log from the commit of package perl-DateTime-Format-Natural for
openSUSE:Factory checked in at 2019-12-09 21:35:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-DateTime-Format-Natural (Old)
and /work/SRC/openSUSE:Factory/.perl-DateTime-Format-Natural.new.4691
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-DateTime-Format-Natural"
Mon Dec 9 21:35:23 2019 rev:2 rq:755146 version:1.08
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-DateTime-Format-Natural/perl-DateTime-Format-Natural.changes
2019-05-16 22:05:53.438518329 +0200
+++
/work/SRC/openSUSE:Factory/.perl-DateTime-Format-Natural.new.4691/perl-DateTime-Format-Natural.changes
2019-12-09 21:35:32.990090438 +0100
@@ -1,0 +2,25 @@
+Sun Dec 8 03:17:54 UTC 2019 - <[email protected]>
+
+- updated to 1.08
+ see /usr/share/doc/packages/perl-DateTime-Format-Natural/Changes
+
+ 1.08 2019-12-07 <[email protected]>
+
+ - Merged development version to stable.
+
+ 1.07_03 2019-12-06 <[email protected]>
+
+ - New supported formats: <count> seconds/minutes before/after
+ yesterday/today/tomorrow. [github #6 - Felix Ostmann]
+
+ 1.07_02 2019-11-19 <[email protected]>
+
+ - New supported format: <count> hours before/after today.
+ [github #6 - Felix Ostmann]
+
+ 1.07_01 2019-10-27 <[email protected]>
+
+ - New supported formats: <count> <unit> before/after
+ noon/midnight. [github #6 - Felix Ostmann]
+
+-------------------------------------------------------------------
Old:
----
DateTime-Format-Natural-1.07.tar.gz
New:
----
DateTime-Format-Natural-1.08.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-DateTime-Format-Natural.spec ++++++
--- /var/tmp/diff_new_pack.FfClBO/_old 2019-12-09 21:35:34.218089955 +0100
+++ /var/tmp/diff_new_pack.FfClBO/_new 2019-12-09 21:35:34.218089955 +0100
@@ -17,7 +17,7 @@
Name: perl-DateTime-Format-Natural
-Version: 1.07
+Version: 1.08
Release: 0
%define cpan_name DateTime-Format-Natural
Summary: Parse informal natural language date/time strings
@@ -55,7 +55,7 @@
%prep
%setup -q -n %{cpan_name}-%{version}
-find . -type f ! -name \*.pl -print0 | xargs -0 chmod 644
+find . -type f ! -path "*/t/*" ! -name "*.pl" ! -path "*/bin/*" ! -path
"*/script/*" ! -name "configure" -print0 | xargs -0 chmod 644
%build
perl Build.PL installdirs=vendor
@@ -70,6 +70,6 @@
%files -f %{name}.files
%defattr(-,root,root,755)
-%doc Changes README scripts
+%doc Changes README
%changelog
++++++ DateTime-Format-Natural-1.07.tar.gz ->
DateTime-Format-Natural-1.08.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/DateTime-Format-Natural-1.07/Changes
new/DateTime-Format-Natural-1.08/Changes
--- old/DateTime-Format-Natural-1.07/Changes 2019-03-29 20:34:34.000000000
+0100
+++ new/DateTime-Format-Natural-1.08/Changes 2019-12-07 21:50:34.000000000
+0100
@@ -1,5 +1,24 @@
Revision history for Perl extension DateTime::Format::Natural.
+1.08 2019-12-07 <[email protected]>
+
+ - Merged development version to stable.
+
+1.07_03 2019-12-06 <[email protected]>
+
+ - New supported formats: <count> seconds/minutes before/after
+ yesterday/today/tomorrow. [github #6 - Felix Ostmann]
+
+1.07_02 2019-11-19 <[email protected]>
+
+ - New supported format: <count> hours before/after today.
+ [github #6 - Felix Ostmann]
+
+1.07_01 2019-10-27 <[email protected]>
+
+ - New supported formats: <count> <unit> before/after
+ noon/midnight. [github #6 - Felix Ostmann]
+
1.07 2019-03-29 <[email protected]>
- Merged development version to stable.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/DateTime-Format-Natural-1.07/META.json
new/DateTime-Format-Natural-1.08/META.json
--- old/DateTime-Format-Natural-1.07/META.json 2019-03-29 20:34:34.000000000
+0100
+++ new/DateTime-Format-Natural-1.08/META.json 2019-12-07 21:50:34.000000000
+0100
@@ -4,13 +4,13 @@
"Steven Schubiger <[email protected]>"
],
"dynamic_config" : 1,
- "generated_by" : "Module::Build version 0.4224",
+ "generated_by" : "Module::Build version 0.4229",
"license" : [
"perl_5"
],
"meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
- "version" : "2"
+ "version" : 2
},
"name" : "DateTime-Format-Natural",
"prereqs" : {
@@ -53,11 +53,11 @@
"provides" : {
"DateTime::Format::Natural" : {
"file" : "lib/DateTime/Format/Natural.pm",
- "version" : "1.07"
+ "version" : "1.08"
},
"DateTime::Format::Natural::Calc" : {
"file" : "lib/DateTime/Format/Natural/Calc.pm",
- "version" : "1.42"
+ "version" : "1.44"
},
"DateTime::Format::Natural::Compat" : {
"file" : "lib/DateTime/Format/Natural/Compat.pm",
@@ -93,7 +93,7 @@
},
"DateTime::Format::Natural::Lang::EN" : {
"file" : "lib/DateTime/Format/Natural/Lang/EN.pm",
- "version" : "1.63"
+ "version" : "1.66"
},
"DateTime::Format::Natural::Rewrite" : {
"file" : "lib/DateTime/Format/Natural/Rewrite.pm",
@@ -121,6 +121,6 @@
"url" : "https://github.com/stsc/DateTime-Format-Natural"
}
},
- "version" : "1.07",
- "x_serialization_backend" : "JSON::PP version 2.27300_01"
+ "version" : "1.08",
+ "x_serialization_backend" : "JSON::PP version 2.97001"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/DateTime-Format-Natural-1.07/META.yml
new/DateTime-Format-Natural-1.08/META.yml
--- old/DateTime-Format-Natural-1.07/META.yml 2019-03-29 20:34:34.000000000
+0100
+++ new/DateTime-Format-Natural-1.08/META.yml 2019-12-07 21:50:34.000000000
+0100
@@ -13,7 +13,7 @@
configure_requires:
Module::Build: '0.42'
dynamic_config: 1
-generated_by: 'Module::Build version 0.4224, CPAN::Meta::Converter version
2.150005'
+generated_by: 'Module::Build version 0.4229, CPAN::Meta::Converter version
2.150010'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -22,10 +22,10 @@
provides:
DateTime::Format::Natural:
file: lib/DateTime/Format/Natural.pm
- version: '1.07'
+ version: '1.08'
DateTime::Format::Natural::Calc:
file: lib/DateTime/Format/Natural/Calc.pm
- version: '1.42'
+ version: '1.44'
DateTime::Format::Natural::Compat:
file: lib/DateTime/Format/Natural/Compat.pm
version: '0.07'
@@ -52,7 +52,7 @@
version: '1.08'
DateTime::Format::Natural::Lang::EN:
file: lib/DateTime/Format/Natural/Lang/EN.pm
- version: '1.63'
+ version: '1.66'
DateTime::Format::Natural::Rewrite:
file: lib/DateTime/Format/Natural/Rewrite.pm
version: '0.06'
@@ -83,5 +83,5 @@
resources:
license: http://dev.perl.org/licenses/
repository: https://github.com/stsc/DateTime-Format-Natural
-version: '1.07'
+version: '1.08'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/DateTime-Format-Natural-1.07/Makefile.PL
new/DateTime-Format-Natural-1.08/Makefile.PL
--- old/DateTime-Format-Natural-1.07/Makefile.PL 2019-03-29
20:34:34.000000000 +0100
+++ new/DateTime-Format-Natural-1.08/Makefile.PL 2019-12-07
21:50:34.000000000 +0100
@@ -1,4 +1,4 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.4224
+# Note: this file was auto-generated by Module::Build::Compat version 0.4229
use ExtUtils::MakeMaker;
WriteMakefile
(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/DateTime-Format-Natural-1.07/README
new/DateTime-Format-Natural-1.08/README
--- old/DateTime-Format-Natural-1.07/README 2019-03-29 20:34:34.000000000
+0100
+++ new/DateTime-Format-Natural-1.08/README 2019-12-07 21:50:34.000000000
+0100
@@ -205,6 +205,7 @@
Debian Perl Group
Tim Bunce
Ricardo Signes
+ Felix Ostmann
SEE ALSO
dateparse, DateTime, Date::Calc, <http://datetime.perl.org>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/DateTime-Format-Natural-1.07/lib/DateTime/Format/Natural/Calc.pm
new/DateTime-Format-Natural-1.08/lib/DateTime/Format/Natural/Calc.pm
--- old/DateTime-Format-Natural-1.07/lib/DateTime/Format/Natural/Calc.pm
2019-03-29 20:34:34.000000000 +0100
+++ new/DateTime-Format-Natural-1.08/lib/DateTime/Format/Natural/Calc.pm
2019-12-07 21:50:34.000000000 +0100
@@ -12,7 +12,7 @@
use constant AFTERNOON => '14';
use constant EVENING => '20';
-our $VERSION = '1.42';
+our $VERSION = '1.44';
sub _no_op
{
@@ -87,10 +87,10 @@
my ($value, $when) = @_;
my $hours = $opts->{hours} || 0;
if ($self->_valid_time(hour => $hours)) {
- $self->_set(hour => $hours);
+ $self->_set(hour => $hours, minute => 0, second => 0);
$self->_add_or_subtract({
when => $when,
- unit => 'hour',
+ unit => $opts->{unit},
value => $value,
});
}
@@ -246,20 +246,19 @@
}
}
-sub _daytime_hours_variant
+sub _daytime_unit_variant
{
my $self = shift;
$self->_register_trace;
my $opts = pop;
- my ($hours, $when, $days) = @_;
- my %values = (
- -1 => { day => ($days - 1), hours => (24 - $hours) },
- 1 => { day => $days, hours => (0 + $hours) },
- );
- if ($self->_valid_time(hour => $values{$when}->{hours})) {
- $self->_add(day => $values{$when}->{day});
- $self->_set(hour => $values{$when}->{hours});
- }
+ my ($value, $when, $days) = @_;
+ $self->_add(day => $days);
+ $self->_set(hour => 0, minute => 0, second => 0);
+ $self->_add_or_subtract({
+ when => $when,
+ unit => $opts->{unit},
+ value => $value,
+ });
}
# wrapper for <time> AM/PM
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/DateTime-Format-Natural-1.07/lib/DateTime/Format/Natural/Lang/EN.pm
new/DateTime-Format-Natural-1.08/lib/DateTime/Format/Natural/Lang/EN.pm
--- old/DateTime-Format-Natural-1.07/lib/DateTime/Format/Natural/Lang/EN.pm
2019-03-29 20:34:34.000000000 +0100
+++ new/DateTime-Format-Natural-1.08/lib/DateTime/Format/Natural/Lang/EN.pm
2019-12-07 21:50:34.000000000 +0100
@@ -13,7 +13,7 @@
use DateTime::Format::Natural::Helpers qw(%flag);
-our $VERSION = '1.63';
+our $VERSION = '1.66';
our (%init,
%timespan,
@@ -3450,6 +3450,36 @@
daytime_hours_variant => [
[ 'REGEXP', 'REGEXP', 'REGEXP', 'REGEXP' ],
[
+ { 0 => $RE{number}, 1 => qr/^(seconds?)$/i, 2 => qr/^(before)$/i, 3
=> qr/^(yesterday)$/i },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ { 3 => [ $flag{yes_today_tom} ] },
+ ],
+ ],
+ [ { unit => 'second' } ],
+ [ '_daytime_unit_variant' ],
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(minutes?)$/i, 2 => qr/^(before)$/i, 3
=> qr/^(yesterday)$/i },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ { 3 => [ $flag{yes_today_tom} ] },
+ ],
+ ],
+ [ { unit => 'minute' } ],
+ [ '_daytime_unit_variant' ],
+ {},
+ ],
+ [
{ 0 => $RE{number}, 1 => qr/^(hours?)$/i, 2 => qr/^(before)$/i, 3 =>
qr/^(yesterday)$/i },
[ [ 0, 1 ] ],
[ $extended_checks{suffix} ],
@@ -3460,9 +3490,84 @@
{ 3 => [ $flag{yes_today_tom} ] },
],
],
- [ {} ],
- [ '_daytime_hours_variant' ],
- { truncate_to => [q(hour)] },
+ [ { unit => 'hour' } ],
+ [ '_daytime_unit_variant' ],
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(seconds?)$/i, 2 => qr/^(before)$/i, 3
=> qr/^(today)$/i },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ { 3 => [ $flag{yes_today_tom} ] },
+ ],
+ ],
+ [ { unit => 'second' } ],
+ [ '_daytime_unit_variant' ],
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(minutes?)$/i, 2 => qr/^(before)$/i, 3
=> qr/^(today)$/i },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ { 3 => [ $flag{yes_today_tom} ] },
+ ],
+ ],
+ [ { unit => 'minute' } ],
+ [ '_daytime_unit_variant' ],
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(hours?)$/i, 2 => qr/^(before)$/i, 3 =>
qr/^(today)$/i },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ { 3 => [ $flag{yes_today_tom} ] },
+ ],
+ ],
+ [ { unit => 'hour' } ],
+ [ '_daytime_unit_variant' ],
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(seconds?)$/i, 2 => qr/^(before)$/i, 3
=> qr/^(tomorrow)$/i },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ { 3 => [ $flag{yes_today_tom} ] },
+ ],
+ ],
+ [ { unit => 'second' } ],
+ [ '_daytime_unit_variant' ],
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(minutes?)$/i, 2 => qr/^(before)$/i, 3
=> qr/^(tomorrow)$/i },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ { 3 => [ $flag{yes_today_tom} ] },
+ ],
+ ],
+ [ { unit => 'minute' } ],
+ [ '_daytime_unit_variant' ],
+ {},
],
[
{ 0 => $RE{number}, 1 => qr/^(hours?)$/i, 2 => qr/^(before)$/i, 3 =>
qr/^(tomorrow)$/i },
@@ -3475,9 +3580,39 @@
{ 3 => [ $flag{yes_today_tom} ] },
],
],
- [ {} ],
- [ '_daytime_hours_variant' ],
- { truncate_to => [q(hour)] },
+ [ { unit => 'hour' } ],
+ [ '_daytime_unit_variant' ],
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(seconds?)$/i, 2 => qr/^(after)$/i, 3 =>
qr/^(yesterday)$/i },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ { 3 => [ $flag{yes_today_tom} ] },
+ ],
+ ],
+ [ { unit => 'second' } ],
+ [ '_daytime_unit_variant' ],
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(minutes?)$/i, 2 => qr/^(after)$/i, 3 =>
qr/^(yesterday)$/i },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ { 3 => [ $flag{yes_today_tom} ] },
+ ],
+ ],
+ [ { unit => 'minute' } ],
+ [ '_daytime_unit_variant' ],
+ {},
],
[
{ 0 => $RE{number}, 1 => qr/^(hours?)$/i, 2 => qr/^(after)$/i, 3 =>
qr/^(yesterday)$/i },
@@ -3490,9 +3625,84 @@
{ 3 => [ $flag{yes_today_tom} ] },
],
],
- [ {} ],
- [ '_daytime_hours_variant' ],
- { truncate_to => [q(hour)] },
+ [ { unit => 'hour' } ],
+ [ '_daytime_unit_variant' ],
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(seconds?)$/i, 2 => qr/^(after)$/i, 3 =>
qr/^(today)$/i },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ { 3 => [ $flag{yes_today_tom} ] },
+ ],
+ ],
+ [ { unit => 'second' } ],
+ [ '_daytime_unit_variant' ],
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(minutes?)$/i, 2 => qr/^(after)$/i, 3 =>
qr/^(today)$/i },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ { 3 => [ $flag{yes_today_tom} ] },
+ ],
+ ],
+ [ { unit => 'minute' } ],
+ [ '_daytime_unit_variant' ],
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(hours?)$/i, 2 => qr/^(after)$/i, 3 =>
qr/^(today)$/i },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ { 3 => [ $flag{yes_today_tom} ] },
+ ],
+ ],
+ [ { unit => 'hour' } ],
+ [ '_daytime_unit_variant' ],
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(seconds?)$/i, 2 => qr/^(after)$/i, 3 =>
qr/^(tomorrow)$/i },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ { 3 => [ $flag{yes_today_tom} ] },
+ ],
+ ],
+ [ { unit => 'second' } ],
+ [ '_daytime_unit_variant' ],
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(minutes?)$/i, 2 => qr/^(after)$/i, 3 =>
qr/^(tomorrow)$/i },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ { 3 => [ $flag{yes_today_tom} ] },
+ ],
+ ],
+ [ { unit => 'minute' } ],
+ [ '_daytime_unit_variant' ],
+ {},
],
[
{ 0 => $RE{number}, 1 => qr/^(hours?)$/i, 2 => qr/^(after)$/i, 3 =>
qr/^(tomorrow)$/i },
@@ -3505,14 +3715,42 @@
{ 3 => [ $flag{yes_today_tom} ] },
],
],
- [ {} ],
- [ '_daytime_hours_variant' ],
- { truncate_to => [q(hour)] },
+ [ { unit => 'hour' } ],
+ [ '_daytime_unit_variant' ],
+ {},
],
],
- hourtime_before_variant => [
+ hourtime_before_after_variant => [
[ 'REGEXP', 'REGEXP', 'REGEXP', 'SCALAR' ],
[
+ { 0 => $RE{number}, 1 => qr/^(seconds?)$/i, 2 => qr/^(before)$/i, 3
=> 'noon' },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ ],
+ ],
+ [ { hours => 12, unit => 'second' } ],
+ [ '_hourtime_variant' ],
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(minutes?)$/i, 2 => qr/^(before)$/i, 3
=> 'noon' },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ ],
+ ],
+ [ { hours => 12, unit => 'minute' } ],
+ [ '_hourtime_variant' ],
+ {},
+ ],
+ [
{ 0 => $RE{number}, 1 => qr/^(hours?)$/i, 2 => qr/^(before)$/i, 3 =>
'noon' },
[ [ 0, 1 ] ],
[ $extended_checks{suffix} ],
@@ -3522,9 +3760,37 @@
{ 2 => [ $flag{before_after_from} ] },
],
],
- [ { hours => 12 } ],
+ [ { hours => 12, unit => 'hour' } ],
[ '_hourtime_variant' ],
- { truncate_to => [q(hour)] },
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(seconds?)$/i, 2 => qr/^(before)$/i, 3
=> 'midnight' },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ ],
+ ],
+ [ { unit => 'second' } ],
+ [ '_hourtime_variant' ],
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(minutes?)$/i, 2 => qr/^(before)$/i, 3
=> 'midnight' },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ ],
+ ],
+ [ { unit => 'minute' } ],
+ [ '_hourtime_variant' ],
+ {},
],
[
{ 0 => $RE{number}, 1 => qr/^(hours?)$/i, 2 => qr/^(before)$/i, 3 =>
'midnight' },
@@ -3536,9 +3802,37 @@
{ 2 => [ $flag{before_after_from} ] },
],
],
- [ {} ],
+ [ { unit => 'hour' } ],
[ '_hourtime_variant' ],
- { truncate_to => [q(hour)] },
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(seconds?)$/i, 2 => qr/^(after)$/i, 3 =>
'noon' },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ ],
+ ],
+ [ { hours => 12, unit => 'second' } ],
+ [ '_hourtime_variant' ],
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(minutes?)$/i, 2 => qr/^(after)$/i, 3 =>
'noon' },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ ],
+ ],
+ [ { hours => 12, unit => 'minute' } ],
+ [ '_hourtime_variant' ],
+ {},
],
[
{ 0 => $RE{number}, 1 => qr/^(hours?)$/i, 2 => qr/^(after)$/i, 3 =>
'noon' },
@@ -3550,9 +3844,37 @@
{ 2 => [ $flag{before_after_from} ] },
],
],
- [ { hours => 12 } ],
+ [ { hours => 12, unit => 'hour' } ],
[ '_hourtime_variant' ],
- { truncate_to => [q(hour)] },
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(seconds?)$/i, 2 => qr/^(after)$/i, 3 =>
'midnight' },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ ],
+ ],
+ [ { unit => 'second' } ],
+ [ '_hourtime_variant' ],
+ {},
+ ],
+ [
+ { 0 => $RE{number}, 1 => qr/^(minutes?)$/i, 2 => qr/^(after)$/i, 3 =>
'midnight' },
+ [ [ 0, 1 ] ],
+ [ $extended_checks{suffix} ],
+ [
+ [
+ 0,
+ { 2 => [ $flag{before_after_from} ] },
+ ],
+ ],
+ [ { unit => 'minute' } ],
+ [ '_hourtime_variant' ],
+ {},
],
[
{ 0 => $RE{number}, 1 => qr/^(hours?)$/i, 2 => qr/^(after)$/i, 3 =>
'midnight' },
@@ -3564,9 +3886,9 @@
{ 2 => [ $flag{before_after_from} ] },
],
],
- [ {} ],
+ [ { unit => 'hour' } ],
[ '_hourtime_variant' ],
- { truncate_to => [q(hour)] },
+ {},
],
],
day_at => [
@@ -4310,13 +4632,35 @@
11 january next year
11 january this year
11 january last year
+ 6 seconds before yesterday
+ 6 minutes before yesterday
6 hours before yesterday
+ 6 seconds before today
+ 6 minutes before today
+ 6 hours before today
+ 6 seconds before tomorrow
+ 6 minutes before tomorrow
6 hours before tomorrow
+ 3 seconds after yesterday
+ 3 minutes after yesterday
3 hours after yesterday
+ 3 seconds after today
+ 3 minutes after today
+ 3 hours after today
+ 3 seconds after tomorrow
+ 3 minutes after tomorrow
3 hours after tomorrow
+ 10 seconds before noon
+ 10 minutes before noon
10 hours before noon
+ 10 seconds before midnight
+ 10 minutes before midnight
10 hours before midnight
+ 5 seconds after noon
+ 5 minutes after noon
5 hours after noon
+ 5 seconds after midnight
+ 5 minutes after midnight
5 hours after midnight
noon last friday
midnight last friday
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/DateTime-Format-Natural-1.07/lib/DateTime/Format/Natural.pm
new/DateTime-Format-Natural-1.08/lib/DateTime/Format/Natural.pm
--- old/DateTime-Format-Natural-1.07/lib/DateTime/Format/Natural.pm
2019-03-29 20:34:34.000000000 +0100
+++ new/DateTime-Format-Natural-1.08/lib/DateTime/Format/Natural.pm
2019-12-07 21:50:34.000000000 +0100
@@ -21,7 +21,7 @@
use Scalar::Util qw(blessed);
use Storable qw(dclone);
-our $VERSION = '1.07';
+our $VERSION = '1.08';
validation_options(
on_fail => sub
@@ -869,6 +869,7 @@
Debian Perl Group
Tim Bunce
Ricardo Signes
+ Felix Ostmann
=head1 SEE ALSO
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/DateTime-Format-Natural-1.07/t/01-parse.t
new/DateTime-Format-Natural-1.08/t/01-parse.t
--- old/DateTime-Format-Natural-1.07/t/01-parse.t 2019-03-29
20:34:34.000000000 +0100
+++ new/DateTime-Format-Natural-1.08/t/01-parse.t 2019-12-07
21:50:34.000000000 +0100
@@ -188,13 +188,35 @@
{ '11 january next year' => '11.01.2007 00:00:00'
},
{ '11 january this year' => '11.01.2006 00:00:00'
},
{ '11 january last year' => '11.01.2005 00:00:00'
},
+ { '6 seconds before yesterday' => '22.11.2006 23:59:54'
},
+ { '6 minutes before yesterday' => '22.11.2006 23:54:00'
},
{ '6 hours before yesterday' => '22.11.2006 18:00:00'
},
+ { '6 seconds before today' => '23.11.2006 23:59:54'
},
+ { '6 minutes before today' => '23.11.2006 23:54:00'
},
+ { '6 hours before today' => '23.11.2006 18:00:00'
},
+ { '6 seconds before tomorrow' => '24.11.2006 23:59:54'
},
+ { '6 minutes before tomorrow' => '24.11.2006 23:54:00'
},
{ '6 hours before tomorrow' => '24.11.2006 18:00:00'
},
+ { '3 seconds after yesterday' => '23.11.2006 00:00:03'
},
+ { '3 minutes after yesterday' => '23.11.2006 00:03:00'
},
{ '3 hours after yesterday' => '23.11.2006 03:00:00'
},
+ { '3 seconds after today' => '24.11.2006 00:00:03'
},
+ { '3 minutes after today' => '24.11.2006 00:03:00'
},
+ { '3 hours after today' => '24.11.2006 03:00:00'
},
+ { '3 seconds after tomorrow' => '25.11.2006 00:00:03'
},
+ { '3 minutes after tomorrow' => '25.11.2006 00:03:00'
},
{ '3 hours after tomorrow' => '25.11.2006 03:00:00'
},
+ { '10 seconds before noon' => '24.11.2006 11:59:50'
},
+ { '10 minutes before noon' => '24.11.2006 11:50:00'
},
{ '10 hours before noon' => '24.11.2006 02:00:00'
},
+ { '10 seconds before midnight' => '23.11.2006 23:59:50'
},
+ { '10 minutes before midnight' => '23.11.2006 23:50:00'
},
{ '10 hours before midnight' => '23.11.2006 14:00:00'
},
+ { '5 seconds after noon' => '24.11.2006 12:00:05'
},
+ { '5 minutes after noon' => '24.11.2006 12:05:00'
},
{ '5 hours after noon' => '24.11.2006 17:00:00'
},
+ { '5 seconds after midnight' => '24.11.2006 00:00:05'
},
+ { '5 minutes after midnight' => '24.11.2006 00:05:00'
},
{ '5 hours after midnight' => '24.11.2006 05:00:00'
},
{ 'noon last friday' => '17.11.2006 12:00:00'
},
{ 'midnight last friday' => '17.11.2006 00:00:00'
},
@@ -281,7 +303,7 @@
{ '+2d' => '26.11.2006 01:13:08' },
);
-_run_tests(669, [ [ \@simple ], [ \@complex ], [ \@specific ] ], \&compare);
+_run_tests(691, [ [ \@simple ], [ \@complex ], [ \@specific ] ], \&compare);
sub compare
{