Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: rt.cpan [...] sartak.org
Cc:
AdminCc:

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



Subject: Weird interaction of 'daynumber monthname' and prefer_future
Hi Steven, We're back with another prefer_future bug! :) This time it's the "daynumber monthname" format. With prefer_future on, it always increments the year. For example: use DateTime::Format::Natural; my $parser = DateTime::Format::Natural->new(prefer_future => 1); warn $parser->parse_datetime("30 december") gives the result: 2008-12-30T22:12:14 even though it should be 2007-12-30. A colleague looked into it and found the problem is that "if you only give a month and optionally a day, it always adds a year, regardless of what day it is now" Thanks for putting up with us. :) Shawn
On Thu Nov 15 17:15:20 2007, SARTAK wrote: Show quoted text
> We're back with another prefer_future bug! :) This time it's the > "daynumber monthname" format. With prefer_future on, it always > increments the year. For example: > > use DateTime::Format::Natural; > my $parser = DateTime::Format::Natural->new(prefer_future => 1); > warn $parser->parse_datetime("30 december") > > gives the result: > > 2008-12-30T22:12:14 > > even though it should be 2007-12-30. > > A colleague looked into it and found the problem is that "if you only > give a month and optionally a day, it always adds a year, regardless of > what day it is now"
Requested functionality has been added to v0.59.