Well, I don't think that the simple is supposed to indicate simple to
parse (at the moment the parser is all but simple... but I am trying
to clean it up).  I read it as "simple formats", i.e. common formats
that define the date and time in fairly straightforward ways (month names
and numbers for things are fine, "next week" "third thursday in the
next month with a blue moon" are not).

The other problem I see is that your regexp only covers English
speaking locales...  I am currently using the DateTime::Locale date to
get locale sensitive information for parsing month and day names.
(Although AM/PM and BC/AD are a bit of a problem, I may need to add
extra information somewhere).

                -ben

On Wed, Jul 16, 2003 at 11:30:33AM -0400, John Siracusa wrote:
> On 7/16/03 11:21 AM, Ben Bennett wrote:
> > On Wed, Jul 16, 2003 at 10:15:46AM -0400, John Siracusa wrote:
> > [snip]
> >> IMO.  Also, I don't think DT::Infinite is in the same boat, because
> >> that is a legitimate date (that DT::F::Simple must parse, BTW:
> >> /^([-+])?inf(?:inity)?$/i).  Returning DT::Infinite is not an error!
> > 
> > Is infinity really a simple date?  I think no.  Anyone else want to
> > weigh in?
> 
> Either way, I'll weigh in again! :)  Of course it's "simple" because, in the
> context of DT::F::Simple, "simple" means "simple to parse."  And this is
> pretty darned simple, IMO:
> 
>   if(/^([-+])?inf(?:inity)?$/i)
>   {
>     if($1 eq '-')
>     {
>       return DateTime::Infinite::Past->new;
>     }
> 
>     return DateTime::Infinite::Future->new;
>   }
> 
> -John

Reply via email to