r46543 - in /branches/upstream/libdatetime-format-natural-perl/current: ./ lib/DateTime/Format/ lib/DateTime/Format/Natural/ lib/DateTime/Format/Natural/Lang/ scripts/ t/
carnil-guest at users.alioth.debian.org
carnil-guest at users.alioth.debian.org
Fri Oct 30 21:36:04 UTC 2009
Author: carnil-guest
Date: Fri Oct 30 21:35:47 2009
New Revision: 46543
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=46543
Log:
[svn-upgrade] Integrating new upstream version, libdatetime-format-natural-perl (0.80)
Modified:
branches/upstream/libdatetime-format-natural-perl/current/Changes
branches/upstream/libdatetime-format-natural-perl/current/META.yml
branches/upstream/libdatetime-format-natural-perl/current/README
branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural.pm
branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Base.pm
branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Compat.pm
branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Duration.pm
branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Helpers.pm
branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/Base.pm
branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/EN.pm
branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Test.pm
branches/upstream/libdatetime-format-natural-perl/current/scripts/dateparse
branches/upstream/libdatetime-format-natural-perl/current/t/01-parse.t
branches/upstream/libdatetime-format-natural-perl/current/t/06-parse_prefer_future.t
Modified: branches/upstream/libdatetime-format-natural-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/Changes?rev=46543&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/Changes (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/Changes Fri Oct 30 21:35:47 2009
@@ -1,4 +1,26 @@
Revision history for Perl extension DateTime::Format::Natural.
+
+0.80 Fri Oct 30 10:15:53 CET 2009
+
+ - Merged development version to stable.
+
+0.79_02 Mon Oct 26 10:11:09 CET 2009
+
+ - Improve wording and formatting of the documentation.
+
+ - Update broken license links.
+
+0.79_01 Mon Oct 19 13:30:14 CEST 2009
+
+ - Parse certain common variations of AM/PM or missing " at ".
+ [rt #50547 - Andrew Sterling Hanenkamp]
+
+ - Match case-insensitively for grammar regular expressions.
+
+ - Rename _at() to _at_time() and wrap it twice; dispatch to
+ _at() instead of _time() where suitable (and vice-versa).
+
+ - Sort the indexes metadata field in ascending order.
0.79 Sat Sep 19 12:23:20 CEST 2009
Modified: branches/upstream/libdatetime-format-natural-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/META.yml?rev=46543&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/META.yml (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/META.yml Fri Oct 30 21:35:47 2009
@@ -1,6 +1,6 @@
---
name: DateTime-Format-Natural
-version: 0.79
+version: 0.80
author:
- 'Steven Schubiger <schubiger at cpan.org>'
abstract: Create machine readable date/time with natural parsing logic
@@ -29,28 +29,28 @@
provides:
DateTime::Format::Natural:
file: lib/DateTime/Format/Natural.pm
- version: 0.79
+ version: 0.80
DateTime::Format::Natural::Base:
file: lib/DateTime/Format/Natural/Base.pm
- version: 1.26
+ version: 1.28
DateTime::Format::Natural::Compat:
file: lib/DateTime/Format/Natural/Compat.pm
- version: 0.04
+ version: 0.05
DateTime::Format::Natural::Duration:
file: lib/DateTime/Format/Natural/Duration.pm
- version: 0.01
+ version: 0.02
DateTime::Format::Natural::Helpers:
file: lib/DateTime/Format/Natural/Helpers.pm
- version: 0.02
+ version: 0.03
DateTime::Format::Natural::Lang::Base:
file: lib/DateTime/Format/Natural/Lang/Base.pm
- version: 1.01
+ version: 1.02
DateTime::Format::Natural::Lang::EN:
file: lib/DateTime/Format/Natural/Lang/EN.pm
- version: 1.25
+ version: 1.27
DateTime::Format::Natural::Test:
file: lib/DateTime/Format/Natural/Test.pm
- version: 0.02
+ version: 0.03
generated_by: Module::Build version 0.34
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
Modified: branches/upstream/libdatetime-format-natural-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/README?rev=46543&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/README (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/README Fri Oct 30 21:35:47 2009
@@ -64,13 +64,14 @@
zone recognized by DateTime. Defaults to 'floating'.
* `daytime'
- A hash reference consisting of customized daytime hours, which may
- be selectively changed.
+ An anonymous hash reference consisting of customized daytime hours,
+ which may be selectively changed.
METHODS
parse_datetime
- Creates a `DateTime' object from a human readable date/time string.
+ Returns a DateTime object constructed from a human readable date/time
+ string.
$dt = $parser->parse_datetime($date_string);
$dt = $parser->parse_datetime(string => $date_string);
@@ -78,13 +79,12 @@
* `string'
The date string.
- Returns a DateTime object.
-
parse_datetime_duration
- Creates one or more `DateTime' object(s) from a human readable date/time
- string which may contain timespans/durations. 'Same' interface & options
- as `parse_datetime()', but must be explicitly called in list context.
+ Returns one or more DateTime object(s) constructed from a human readable
+ date/time string which may contain timespans/durations. *Same* interface
+ and options as `parse_datetime()', but should be explicitly called in
+ list context.
@dt = $parser->parse_datetime_duration($date_string);
@dt = $parser->parse_datetime_duration(string => $date_string);
@@ -113,7 +113,7 @@
EXAMPLES
See the classes `DateTime::Format::Natural::Lang::[language_code]' for a
- overview of current valid input.
+ overview of currently valid input.
CREDITS
Thanks to Tatsuhiko Miyagawa for the initial inspiration. See Miyagawa's
@@ -121,7 +121,7 @@
information.
Furthermore, thanks to (in order of appearance) who have contributed
- valuable suggestions & patches:
+ valuable suggestions and patches:
Clayton L. Scott
Dave Rolsky
@@ -145,6 +145,7 @@
Michael Reddick
Christian Brink
Giovanni Pensa
+ Andrew Sterling Hanenkamp
SEE ALSO
DateTime, Date::Calc, http://datetime.perl.org
@@ -156,5 +157,5 @@
This program is free software; you may redistribute it and/or modify it
under the same terms as Perl itself.
- See http://www.perl.com/perl/misc/Artistic.html
+ See http://dev.perl.org/licenses/
Modified: branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural.pm?rev=46543&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural.pm (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural.pm Fri Oct 30 21:35:47 2009
@@ -16,7 +16,7 @@
use Scalar::Util qw(blessed);
use Storable qw(dclone);
-our $VERSION = '0.79';
+our $VERSION = '0.80';
validation_options(
on_fail => sub
@@ -378,7 +378,7 @@
foreach my $expression (@grammar) {
my $valid_expression = true;
my $definition = $expression->[0];
- my @positions = keys %$definition;
+ my @positions = sort {$a <=> $b} keys %$definition;
my %regex_stack;
foreach my $pos (@positions) {
if ($types->[$pos] eq 'SCALAR') {
@@ -618,7 +618,7 @@
=item * C<datetime>
-Overrides the present now with a DateTime object provided.
+Overrides the present now with a L<DateTime> object provided.
=item * C<lang>
@@ -641,8 +641,8 @@
=item * C<daytime>
-A hash reference consisting of customized daytime hours, which may be
-selectively changed.
+An anonymous hash reference consisting of customized daytime hours,
+which may be selectively changed.
=back
@@ -650,7 +650,7 @@
=head2 parse_datetime
-Creates a C<DateTime> object from a human readable date/time string.
+Returns a L<DateTime> object constructed from a human readable date/time string.
$dt = $parser->parse_datetime($date_string);
$dt = $parser->parse_datetime(string => $date_string);
@@ -663,13 +663,12 @@
=back
-Returns a L<DateTime> object.
-
=head2 parse_datetime_duration
-Creates one or more C<DateTime> object(s) from a human readable date/time string
-which may contain timespans/durations. 'Same' interface & options as C<parse_datetime()>,
-but must be explicitly called in list context.
+Returns one or more L<DateTime> object(s) constructed from a human readable
+date/time string which may contain timespans/durations. I<Same> interface
+and options as C<parse_datetime()>, but should be explicitly called in
+list context.
@dt = $parser->parse_datetime_duration($date_string);
@dt = $parser->parse_datetime_duration(string => $date_string);
@@ -699,7 +698,7 @@
=head1 EXAMPLES
See the classes C<DateTime::Format::Natural::Lang::[language_code]> for a
-overview of current valid input.
+overview of currently valid input.
=head1 CREDITS
@@ -707,7 +706,7 @@
entry L<http://use.perl.org/~miyagawa/journal/31378> for more information.
Furthermore, thanks to (in order of appearance) who have contributed
-valuable suggestions & patches:
+valuable suggestions and patches:
Clayton L. Scott
Dave Rolsky
@@ -731,6 +730,7 @@
Michael Reddick
Christian Brink
Giovanni Pensa
+ Andrew Sterling Hanenkamp
=head1 SEE ALSO
@@ -745,6 +745,6 @@
This program is free software; you may redistribute it and/or
modify it under the same terms as Perl itself.
-See L<http://www.perl.com/perl/misc/Artistic.html>
+See L<http://dev.perl.org/licenses/>
=cut
Modified: branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Base.pm?rev=46543&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Base.pm (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Base.pm Fri Oct 30 21:35:47 2009
@@ -4,7 +4,7 @@
use warnings;
use base qw(DateTime::Format::Natural::Compat);
-our $VERSION = '1.26';
+our $VERSION = '1.28';
use constant MORNING => '08';
use constant AFTERNOON => '14';
@@ -286,6 +286,19 @@
{
my $self = shift;
$self->_register_trace;
+ $self->_at_time(@_);
+}
+
+sub _time
+{
+ my $self = shift;
+ $self->_register_trace;
+ $self->_at_time(@_);
+}
+
+sub _at_time
+{
+ my $self = shift;
my $opts = pop;
my $hours = $opts->{hours} || 0;
my ($time) = @_;
@@ -308,12 +321,6 @@
}
}
-sub _time
-{
- my $self = shift;
- $self->_at(@_);
-}
-
sub _time_full
{
my $self = shift;
@@ -450,6 +457,6 @@
This program is free software; you may redistribute it and/or
modify it under the same terms as Perl itself.
-See L<http://www.perl.com/perl/misc/Artistic.html>
+See L<http://dev.perl.org/licenses/>
=cut
Modified: branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Compat.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Compat.pm?rev=46543&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Compat.pm (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Compat.pm Fri Oct 30 21:35:47 2009
@@ -8,7 +8,7 @@
our ($VERSION, $Pure);
-$VERSION = '0.04';
+$VERSION = '0.05';
BEGIN
{
@@ -185,6 +185,6 @@
This program is free software; you may redistribute it and/or
modify it under the same terms as Perl itself.
-See L<http://www.perl.com/perl/misc/Artistic.html>
+See L<http://dev.perl.org/licenses/>
=cut
Modified: branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Duration.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Duration.pm?rev=46543&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Duration.pm (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Duration.pm Fri Oct 30 21:35:47 2009
@@ -3,7 +3,7 @@
use strict;
use warnings;
-our $VERSION = '0.01';
+our $VERSION = '0.02';
sub _pre_duration
{
@@ -96,6 +96,6 @@
This program is free software; you may redistribute it and/or
modify it under the same terms as Perl itself.
-See L<http://www.perl.com/perl/misc/Artistic.html>
+See L<http://dev.perl.org/licenses/>
=cut
Modified: branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Helpers.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Helpers.pm?rev=46543&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Helpers.pm (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Helpers.pm Fri Oct 30 21:35:47 2009
@@ -10,7 +10,7 @@
our ($VERSION, @EXPORT_OK, %flag);
-$VERSION = '0.02';
+$VERSION = '0.03';
my @flags = (
{ weekday_name => REAL_FLAG },
@@ -224,6 +224,6 @@
This program is free software; you may redistribute it and/or
modify it under the same terms as Perl itself.
-See L<http://www.perl.com/perl/misc/Artistic.html>
+See L<http://dev.perl.org/licenses/>
=cut
Modified: branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/Base.pm?rev=46543&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/Base.pm (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/Base.pm Fri Oct 30 21:35:47 2009
@@ -5,7 +5,7 @@
our ($VERSION, $AUTOLOAD);
-$VERSION = '1.01';
+$VERSION = '1.02';
sub __new
{
@@ -76,6 +76,6 @@
This program is free software; you may redistribute it and/or
modify it under the same terms as Perl itself.
-See L<http://www.perl.com/perl/misc/Artistic.html>
+See L<http://dev.perl.org/licenses/>
=cut
Modified: branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/EN.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/EN.pm?rev=46543&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/EN.pm (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Lang/EN.pm Fri Oct 30 21:35:47 2009
@@ -9,7 +9,7 @@
use DateTime::Format::Natural::Helpers qw(%flag);
-our $VERSION = '1.25';
+our $VERSION = '1.27';
our (%init,
%timespan,
@@ -32,11 +32,11 @@
%RE = (number => qr/^(\d+)$/,
year => qr/^(\d{4})$/,
time => qr/^((?:\d{1,2})(?:\:\d{2})?)$/,
- time_am => qr/^((?:\d{1,2})(?:\:\d{2})?)(?:am)?$/,
- time_pm => qr/^((?:\d{1,2})(?:\:\d{2})?)pm$/,
+ time_am => qr/^((?:\d{1,2})(?:\:\d{2})?)(?:am)?$/i,
+ time_pm => qr/^((?:\d{1,2})(?:\:\d{2})?)pm$/i,
time_full => qr/^(\d{1,2}\:\d{2}\:\d{2})$/,
- day => qr/^(\d+)(?:st|nd|rd|th)?$/,
- monthday => qr/^(\d{1,2})(?:st|nd|rd|th)?$/);
+ day => qr/^(\d+)(?:st|nd|rd|th)?$/i,
+ monthday => qr/^(\d{1,2})(?:st|nd|rd|th)?$/i);
{
my $i = 1;
@@ -670,7 +670,7 @@
],
],
[ {}, { unit => 'day' } ],
- [ '_time', '_unit_variant' ],
+ [ '_at', '_unit_variant' ],
{ truncate_to => 'minute' },
],
[
@@ -684,7 +684,7 @@
],
],
[ {}, { unit => 'day' } ],
- [ '_time', '_unit_variant' ],
+ [ '_at', '_unit_variant' ],
{ truncate_to => 'minute' },
],
[
@@ -698,7 +698,7 @@
],
],
[ {}, { unit => 'day' } ],
- [ '_time', '_unit_variant' ],
+ [ '_at', '_unit_variant' ],
{ truncate_to => 'minute' },
],
[
@@ -1415,6 +1415,33 @@
[],
[ [ 0 ] ],
[ {} ],
+ [ '_time' ],
+ {
+ prefer_future => true,
+ truncate_to => 'minute',
+ },
+ ],
+ [
+ { 0 => $RE{time}, 1 => 'pm' },
+ [],
+ [],
+ [ [ 0 ] ],
+ [ { hours => 12 } ],
+ [ '_time' ],
+ {
+ prefer_future => true,
+ truncate_to => 'minute',
+ },
+ ],
+ ],
+ at_combined => [
+ [ 'REGEXP' ],
+ [
+ { 0 => $RE{time_am} },
+ [],
+ [],
+ [ [ 0 ] ],
+ [ {} ],
[ '_at' ],
{
prefer_future => true,
@@ -1422,7 +1449,7 @@
},
],
[
- { 0 => $RE{time}, 1 => 'pm' },
+ { 0 => $RE{time_pm} },
[],
[],
[ [ 0 ] ],
@@ -1434,37 +1461,27 @@
},
],
],
- at_combined => [
- [ 'REGEXP' ],
- [
- { 0 => $RE{time_am} },
- [],
- [],
- [ [ 0 ] ],
- [ {} ],
- [ '_at' ],
+ weekday_time => [
+ [ 'REGEXP', 'REGEXP' ],
+ [
+ { 0 => $RE{weekday}, 1 => $RE{time_am} },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{weekday_name}, $flag{weekday_num} ] },
+ ],
+ [ 1 ],
+ ],
+ [ {}, {} ],
+ [ '_weekday', '_at' ],
{
prefer_future => true,
truncate_to => 'minute',
},
],
[
- { 0 => $RE{time_pm} },
- [],
- [],
- [ [ 0 ] ],
- [ { hours => 12 } ],
- [ '_at' ],
- {
- prefer_future => true,
- truncate_to => 'minute',
- },
- ],
- ],
- weekday_time => [
- [ 'REGEXP', 'REGEXP' ],
- [
- { 0 => $RE{weekday}, 1 => $RE{time_am} },
+ { 0 => $RE{weekday}, 1 => $RE{time_pm} },
[],
[],
[
@@ -1473,25 +1490,8 @@
],
[ 1 ],
],
- [ {}, {} ],
- [ '_weekday', '_time' ],
- {
- prefer_future => true,
- truncate_to => 'minute',
- },
- ],
- [
- { 0 => $RE{weekday}, 1 => $RE{time_pm} },
- [],
- [],
- [
- [
- { 0 => [ $flag{weekday_name}, $flag{weekday_num} ] },
- ],
- [ 1 ],
- ],
[ {}, { hours => 12 } ],
- [ '_weekday', '_time' ],
+ [ '_weekday', '_at' ],
{
prefer_future => true,
truncate_to => 'minute',
@@ -1945,7 +1945,7 @@
[ 5 ],
],
[ { unit => 'month' }, {}, {} ],
- [ '_ago_variant', '_weekday', '_time' ],
+ [ '_ago_variant', '_weekday', '_at' ],
{ truncate_to => 'minute' },
],
[
@@ -2723,10 +2723,142 @@
{ truncate_to => 'hour' },
],
],
- day_at => [
+ day_am_pm => [
+ [ 'REGEXP', 'REGEXP' ],
+ [
+ { 0 => qr/^(yesterday)$/i, 1 => $RE{time_am} },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{yes_today_tom} ] },
+ ],
+ [ 1 ],
+ ],
+ [ { unit => 'day' }, {} ],
+ [ '_unit_variant', '_at' ],
+ { truncate_to => 'minute' },
+ ],
+ [
+ { 0 => qr/^(today)$/i, 1 => $RE{time_am} },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{yes_today_tom} ] },
+ ],
+ [ 1 ],
+ ],
+ [ { unit => 'day' }, {} ],
+ [ '_unit_variant', '_at' ],
+ { truncate_to => 'minute' },
+ ],
+ [
+ { 0 => qr/^(tomorrow)$/i, 1 => $RE{time_am} },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{yes_today_tom} ] },
+ ],
+ [ 1 ],
+ ],
+ [ { unit => 'day' }, {} ],
+ [ '_unit_variant', '_at' ],
+ { truncate_to => 'minute' },
+ ],
+ [
+ { 0 => qr/^(yesterday)$/i, 1 => $RE{time_pm} },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{yes_today_tom} ] },
+ ],
+ [ 1 ],
+ ],
+ [ { unit => 'day' }, { hours => 12 } ],
+ [ '_unit_variant', '_at' ],
+ { truncate_to => 'minute' },
+ ],
+ [
+ { 0 => qr/^(today)$/i, 1 => $RE{time_pm} },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{yes_today_tom} ] },
+ ],
+ [ 1 ],
+ ],
+ [ { unit => 'day' }, { hours => 12 } ],
+ [ '_unit_variant', '_at' ],
+ { truncate_to => 'minute' },
+ ],
+ [
+ { 0 => qr/^(tomorrow)$/i, 1 => $RE{time_pm} },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{yes_today_tom} ] },
+ ],
+ [ 1 ],
+ ],
+ [ { unit => 'day' }, { hours => 12 } ],
+ [ '_unit_variant', '_at' ],
+ { truncate_to => 'minute' },
+ ],
+ ],
+ day_time => [
[ 'REGEXP', 'SCALAR', 'REGEXP' ],
[
{ 0 => qr/^(yesterday)$/i, 1 => 'at', 2 => $RE{time_am} },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{yes_today_tom} ] },
+ ],
+ [ 2 ],
+ ],
+ [ { unit => 'day' }, {} ],
+ [ '_unit_variant', '_at' ],
+ { truncate_to => 'minute' },
+ ],
+ [
+ { 0 => qr/^(today)$/i, 1 => 'at', 2 => $RE{time_am} },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{yes_today_tom} ] },
+ ],
+ [ 2 ],
+ ],
+ [ { unit => 'day' }, {} ],
+ [ '_unit_variant', '_at' ],
+ { truncate_to => 'minute' },
+ ],
+ [
+ { 0 => qr/^(tomorrow)$/i, 1 => 'at', 2 => $RE{time_am} },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{yes_today_tom} ] },
+ ],
+ [ 2 ],
+ ],
+ [ { unit => 'day' }, {} ],
+ [ '_unit_variant', '_at' ],
+ { truncate_to => 'minute' },
+ ],
+ ],
+ day_at_time => [
+ [ 'REGEXP', 'SCALAR', 'REGEXP', 'SCALAR' ],
+ [
+ { 0 => qr/^(yesterday)$/i, 1 => 'at', 2 => $RE{time}, 3 => 'am' },
[],
[],
[
@@ -2740,7 +2872,7 @@
{ truncate_to => 'minute' },
],
[
- { 0 => qr/^(today)$/i, 1 => 'at', 2 => $RE{time_am} },
+ { 0 => qr/^(today)$/i, 1 => 'at', 2 => $RE{time}, 3 => 'am' },
[],
[],
[
@@ -2754,7 +2886,7 @@
{ truncate_to => 'minute' },
],
[
- { 0 => qr/^(tomorrow)$/i, 1 => 'at', 2 => $RE{time_am} },
+ { 0 => qr/^(tomorrow)$/i, 1 => 'at', 2 => $RE{time}, 3 => 'am' },
[],
[],
[
@@ -2767,11 +2899,90 @@
[ '_unit_variant', '_time' ],
{ truncate_to => 'minute' },
],
+ [
+ { 0 => qr/^(yesterday)$/i, 1 => 'at', 2 => $RE{time}, 3 => 'pm' },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{yes_today_tom} ] },
+ ],
+ [ 2 ],
+ ],
+ [ { unit => 'day' }, { hours => 12 } ],
+ [ '_unit_variant', '_time' ],
+ { truncate_to => 'minute' },
+ ],
+ [
+ { 0 => qr/^(today)$/i, 1 => 'at', 2 => $RE{time}, 3 => 'pm' },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{yes_today_tom} ] },
+ ],
+ [ 2 ],
+ ],
+ [ { unit => 'day' }, { hours => 12 } ],
+ [ '_unit_variant', '_time' ],
+ { truncate_to => 'minute' },
+ ],
+ [
+ { 0 => qr/^(tomorrow)$/i, 1 => 'at', 2 => $RE{time}, 3 => 'pm' },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{yes_today_tom} ] },
+ ],
+ [ 2 ],
+ ],
+ [ { unit => 'day' }, { hours => 12 } ],
+ [ '_unit_variant', '_time' ],
+ { truncate_to => 'minute' },
+ ],
],
weekday_at_time => [
[ 'REGEXP', 'SCALAR', 'REGEXP' ],
[
{ 0 => $RE{weekday}, 1 => 'at', 2 => $RE{time_am} },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{weekday_name}, $flag{weekday_num} ] },
+ ],
+ [ 2 ],
+ ],
+ [ {}, {} ],
+ [ '_weekday', '_at' ],
+ {
+ prefer_future => true,
+ truncate_to => 'minute',
+ },
+ ],
+ [
+ { 0 => $RE{weekday}, 1 => 'at', 2 => $RE{time_pm} },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{weekday_name}, $flag{weekday_num} ] },
+ ],
+ [ 2 ],
+ ],
+ [ {}, { hours => 12 } ],
+ [ '_weekday', '_at' ],
+ {
+ prefer_future => true,
+ truncate_to => 'minute',
+ },
+ ],
+ ],
+ weekday_at_am_pm => [
+ [ 'REGEXP', 'SCALAR', 'REGEXP', 'SCALAR' ],
+ [
+ { 0 => $RE{weekday}, 1 => 'at', 2 => $RE{time}, 3 => 'am' },
[],
[],
[
@@ -2787,70 +2998,104 @@
truncate_to => 'minute',
},
],
- ],
- day_at_pm => [
- [ 'REGEXP', 'SCALAR', 'REGEXP' ],
- [
- { 0 => qr/^(yesterday)$/i, 1 => 'at', 2 => $RE{time_pm} },
- [],
- [],
- [
- [
- { 0 => [ $flag{yes_today_tom} ] },
+ [
+ { 0 => $RE{weekday}, 1 => 'at', 2 => $RE{time}, 3 => 'pm' },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{weekday_name}, $flag{weekday_num} ] },
],
[ 2 ],
],
- [ { unit => 'day' }, { hours => 12 } ],
- [ '_unit_variant', '_at' ],
- { truncate_to => 'minute' },
- ],
- [
- { 0 => qr/^(today)$/i, 1 => 'at', 2 => $RE{time_pm} },
- [],
- [],
- [
- [
- { 0 => [ $flag{yes_today_tom} ] },
- ],
- [ 2 ],
- ],
- [ { unit => 'day' }, { hours => 12 } ],
- [ '_unit_variant', '_at' ],
- { truncate_to => 'minute' },
- ],
- [
- { 0 => qr/^(tomorrow)$/i, 1 => 'at', 2 => $RE{time_pm} },
- [],
- [],
- [
- [
- { 0 => [ $flag{yes_today_tom} ] },
- ],
- [ 2 ],
- ],
- [ { unit => 'day' }, { hours => 12 } ],
- [ '_unit_variant', '_at' ],
- { truncate_to => 'minute' },
- ],
- ],
- weekday_at_time_pm => [
- [ 'REGEXP', 'SCALAR', 'REGEXP' ],
- [
- { 0 => $RE{weekday}, 1 => 'at', 2 => $RE{time_pm} },
- [],
- [],
- [
- [
- { 0 => [ $flag{weekday_name}, $flag{weekday_num} ] },
- ],
- [ 2 ],
- ],
[ {}, { hours => 12 } ],
- [ '_weekday', '_at' ],
+ [ '_weekday', '_time' ],
{
prefer_future => true,
truncate_to => 'minute',
},
+ ],
+ ],
+ weekday_am_pm => [
+ [ 'REGEXP', 'REGEXP', 'SCALAR' ],
+ [
+ { 0 => $RE{weekday}, 1 => $RE{time}, 2 => 'am' },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{weekday_name}, $flag{weekday_num} ] },
+ ],
+ [ 1 ],
+ ],
+ [ {}, {} ],
+ [ '_weekday', '_time' ],
+ {
+ prefer_future => true,
+ truncate_to => 'minute',
+ },
+ ],
+ [
+ { 0 => $RE{weekday}, 1 => $RE{time}, 2 => 'pm' },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{weekday_name}, $flag{weekday_num} ] },
+ ],
+ [ 1 ],
+ ],
+ [ {}, { hours => 12 } ],
+ [ '_weekday', '_time' ],
+ {
+ prefer_future => true,
+ truncate_to => 'minute',
+ },
+ ],
+ ],
+ day_at_pm => [
+ [ 'REGEXP', 'SCALAR', 'REGEXP' ],
+ [
+ { 0 => qr/^(yesterday)$/i, 1 => 'at', 2 => $RE{time_pm} },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{yes_today_tom} ] },
+ ],
+ [ 2 ],
+ ],
+ [ { unit => 'day' }, { hours => 12 } ],
+ [ '_unit_variant', '_at' ],
+ { truncate_to => 'minute' },
+ ],
+ [
+ { 0 => qr/^(today)$/i, 1 => 'at', 2 => $RE{time_pm} },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{yes_today_tom} ] },
+ ],
+ [ 2 ],
+ ],
+ [ { unit => 'day' }, { hours => 12 } ],
+ [ '_unit_variant', '_at' ],
+ { truncate_to => 'minute' },
+ ],
+ [
+ { 0 => qr/^(tomorrow)$/i, 1 => 'at', 2 => $RE{time_pm} },
+ [],
+ [],
+ [
+ [
+ { 0 => [ $flag{yes_today_tom} ] },
+ ],
+ [ 2 ],
+ ],
+ [ { unit => 'day' }, { hours => 12 } ],
+ [ '_unit_variant', '_at' ],
+ { truncate_to => 'minute' },
],
],
day_month_year => [
@@ -3201,10 +3446,26 @@
yesterday at 6:45pm
today at 6:45pm
tomorrow at 6:45pm
+ yesterday at 2:32 AM
+ today at 2:32 AM
+ tomorrow at 2:32 AM
+ yesterday at 2:32 PM
+ today at 2:32 PM
+ tomorrow at 2:32 PM
+ yesterday 2:32am
+ today 2:32am
+ tomorrow 2:32am
+ yesterday 2:32pm
+ today 2:32pm
+ tomorrow 2:32pm
wednesday at 14:30
wednesday at 02:30pm
wednesday 14:30
wednesday 02:30pm
+ friday 03:00 am
+ friday 03:00 pm
+ sunday at 05:00 am
+ sunday at 05:00 pm
2nd monday
100th day
4th february
@@ -3363,6 +3624,6 @@
This program is free software; you may redistribute it and/or
modify it under the same terms as Perl itself.
-See L<http://www.perl.com/perl/misc/Artistic.html>
+See L<http://dev.perl.org/licenses/>
=cut
Modified: branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Test.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Test.pm?rev=46543&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Test.pm (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/lib/DateTime/Format/Natural/Test.pm Fri Oct 30 21:35:47 2009
@@ -9,7 +9,7 @@
our ($VERSION, @EXPORT, %time);
-$VERSION = '0.02';
+$VERSION = '0.03';
%time = (
year => 2006,
@@ -95,6 +95,6 @@
This program is free software; you may redistribute it and/or
modify it under the same terms as Perl itself.
-See L<http://www.perl.com/perl/misc/Artistic.html>
+See L<http://dev.perl.org/licenses/>
=cut
Modified: branches/upstream/libdatetime-format-natural-perl/current/scripts/dateparse
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/scripts/dateparse?rev=46543&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/scripts/dateparse (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/scripts/dateparse Fri Oct 30 21:35:47 2009
@@ -160,6 +160,6 @@
This program is free software; you may redistribute it and/or
modify it under the same terms as Perl itself.
-See L<http://www.perl.com/perl/misc/Artistic.html>
+See L<http://dev.perl.org/licenses/>
=cut
Modified: branches/upstream/libdatetime-format-natural-perl/current/t/01-parse.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/t/01-parse.t?rev=46543&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/t/01-parse.t (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/t/01-parse.t Fri Oct 30 21:35:47 2009
@@ -93,10 +93,26 @@
{ 'yesterday at 6:45pm' => '23.11.2006 18:45:00' },
{ 'today at 6:45pm' => '24.11.2006 18:45:00' },
{ 'tomorrow at 6:45pm' => '25.11.2006 18:45:00' },
+ { 'yesterday at 2:32 AM' => '23.11.2006 02:32:00' },
+ { 'today at 2:32 AM' => '24.11.2006 02:32:00' },
+ { 'tomorrow at 2:32 AM' => '25.11.2006 02:32:00' },
+ { 'yesterday at 2:32 PM' => '23.11.2006 14:32:00' },
+ { 'today at 2:32 PM' => '24.11.2006 14:32:00' },
+ { 'tomorrow at 2:32 PM' => '25.11.2006 14:32:00' },
+ { 'yesterday 2:32am' => '23.11.2006 02:32:00' },
+ { 'today 2:32am' => '24.11.2006 02:32:00' },
+ { 'tomorrow 2:32am' => '25.11.2006 02:32:00' },
+ { 'yesterday 2:32pm' => '23.11.2006 14:32:00' },
+ { 'today 2:32pm' => '24.11.2006 14:32:00' },
+ { 'tomorrow 2:32pm' => '25.11.2006 14:32:00' },
{ 'wednesday at 14:30' => '22.11.2006 14:30:00' },
{ 'wednesday at 02:30pm' => '22.11.2006 14:30:00' },
{ 'wednesday 14:30' => '22.11.2006 14:30:00' },
{ 'wednesday 02:30pm' => '22.11.2006 14:30:00' },
+ { 'friday 03:00 am' => '24.11.2006 03:00:00' },
+ { 'friday 03:00 pm' => '24.11.2006 15:00:00' },
+ { 'sunday at 05:00 am' => '26.11.2006 05:00:00' },
+ { 'sunday at 05:00 pm' => '26.11.2006 17:00:00' },
{ '2nd monday' => '13.11.2006 00:00:00' },
{ '100th day' => '10.04.2006 00:00:00' },
{ '4th february' => '04.02.2006 00:00:00' },
@@ -227,7 +243,7 @@
{ '3:20:00' => '24.11.2006 03:20:00' },
);
-_run_tests(210, [ [ \@simple ], [ \@complex ], [ \@specific ] ], \&compare);
+_run_tests(226, [ [ \@simple ], [ \@complex ], [ \@specific ] ], \&compare);
sub compare
{
Modified: branches/upstream/libdatetime-format-natural-perl/current/t/06-parse_prefer_future.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-format-natural-perl/current/t/06-parse_prefer_future.t?rev=46543&op=diff
==============================================================================
--- branches/upstream/libdatetime-format-natural-perl/current/t/06-parse_prefer_future.t (original)
+++ branches/upstream/libdatetime-format-natural-perl/current/t/06-parse_prefer_future.t Fri Oct 30 21:35:47 2009
@@ -37,15 +37,19 @@
);
my @combined = (
- { '4th february' => '04.02.2007 00:00:00' },
- { 'november 3rd' => '03.11.2007 00:00:00' },
- { 'sunday 11:00' => '26.11.2006 11:00:00' },
- { 'monday at 8' => '27.11.2006 08:00:00' },
- { 'tuesday at 8pm' => '28.11.2006 20:00:00' },
- { 'wednesday at 4pm' => '29.11.2006 16:00:00' },
+ { '4th february' => '04.02.2007 00:00:00' },
+ { 'november 3rd' => '03.11.2007 00:00:00' },
+ { 'sunday 11:00' => '26.11.2006 11:00:00' },
+ { 'monday at 8' => '27.11.2006 08:00:00' },
+ { 'tuesday at 8pm' => '28.11.2006 20:00:00' },
+ { 'wednesday at 4pm' => '29.11.2006 16:00:00' },
+ { 'friday 03:00 am' => '24.11.2006 03:00:00' },
+ { 'friday 03:00 pm' => '24.11.2006 15:00:00' },
+ { 'monday at 03:00 am' => '27.11.2006 03:00:00' },
+ { 'monday at 03:00 pm' => '27.11.2006 15:00:00' },
);
-_run_tests(22, [ [ \@simple ], [ \@combined ] ], \&compare);
+_run_tests(26, [ [ \@simple ], [ \@combined ] ], \&compare);
sub compare
{
More information about the Pkg-perl-cvs-commits
mailing list