On Tue, 24 Oct 2006, Steven Schubiger wrote:
If this were to go under DateTime, I'd probably want to have be something
like DateTime::Format::Natural::EN or something like that, since it's
quite possible people will want parsers for other languages as well. I'd
also want it to have an interface more like the other DT::Format modules.
Agreed upon.
I saw that you uploaded a new version with this name. The one other thing
I'd like to see to make it "fit in" is to make parse_datetime a class
method (at least optionally). Also, rather than taking a hash ref of
options, how about just making it check the number of args, so we can do
something like this:
->parse_datetime($string)
->parse_datetime( string => $string, debug => 1 );
This would be more like all the other modules. It's quite possible you'll
need more options in the future. For example, you might want to have a
parameter that allows people to specify whether dates are in mdy or dmy
order.
One thing I was thinking was that maybe eventually there could something
like this:
DateTime::Format::Natural->parse_datetime( string => $string, locale =>
$dt_local_object );
The module could use the locale to figure out what module to load, or
maybe it could construct a parser based on info in the locale. It could
also use the locale to determine the native order for various components.
-dave
/*===================================================
VegGuide.Org www.BookIRead.com
Your guide to all that's veg. My book blog
===================================================*/