Skip Menu |

This queue is for tickets about the DateTime-Format-Natural CPAN distribution.

Report information
The Basics
Id: 30147
Status: resolved
Priority: 0/
Queue: DateTime-Format-Natural

People
Owner: Nobody in particular
Requestors: jason.a.may [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.55
Fixed in: (no value)



Subject: Minute offsetting not supported (plus some requested features)
Hello, I have been working on a project that I wanted to use common English as input for a future time, and I stumbled upon this module. I really like it, but there are a few things that I feel could be extended. The "minutes from now" in any form doesn't seem to be supported, which may be considered as a bug. The rest that I suggest are just possible features you could add if you want. $ re.pl ... $ use DateTime::Format::Natural; sub print_times { my $time_str = shift; my $parser = DateTime::Format::Natural->new; my $dt = $parser->parse_datetime($time_str); return $dt->ymd.' '.$dt->hms."\n"; } $ $ print_times 'now' 2007-10-19 23:26:50 # An offset of a few minutes from now doesn't seem to be supported at all. $ print_times 'in 42 minutes' # does not work 2007-10-19 23:27:15 $ print_times '42 minutes from now' # does not work either 2007-10-19 23:27:22 # Here are some features that could possibly be used, and could be really helpful $ print_times '5 days from now' #works 2007-10-24 23:27:05 $ print_times 'in 5 days' # does not work 2007-10-19 23:26:58 $ print_times 'in 4 hours' # works 2007-10-20 03:27:37 $ print_times '4 hours from now' # does not work 2007-10-19 23:27:42 $ print_times 'tomorrow at 4pm' # works 2007-10-20 16:00:33 $ print_times '4pm tomorrow' # does not work 2007-10-19 23:59:21 Thanks, jasonmay
All suggested changes applied as of version 0.56.