Dave Rolsky wrote:
Actually, the current behavior just seems broken. I'd suggest that you
should _always_ truncate to the most specific parsed value.
The current behavior is just confusing as heck in all the example up above.
Absolutely agree. Your 'date_only' is pointless .. just return to the
precision in the parsed value.
If the input is "this time yesterday" (which would return down to the
nanosecond) and you want the start of the hour, use
->truncate(to=>'hour') on the result.
With strptime, I take a 'base datetime' which would give the existing
behaviour of the Natural module .. it uses it to fill in the blanks, but
your module shouldn't need that.
Cheers!
Rick Measham
--
Message protected for iSite by MailGuard: e-mail anti-virus, anti-spam and
content filtering.
http://www.mailguard.com.au