On Fri, 6 Aug 2004, Rick Measham wrote:

> All parameters are named in DateTime. It's a convention we use and

s/All/Almost all/

There are some that take positional params.  Those are usually cases where
I expect it to never need more than one parameter, _or_ where it takes a
list of similar parameters (strftime).

But any time it takes more than one dissimilar parameter, it'll be named,
and it's also named in cases where it takes one parameter now, but I
thought that might change in the future.

> HOWEVER, that said, I'd like to see some sort of a default format
> method:
>       $dt->set_default_format($strftime_format);
>       print $dt->default_format;
>       print "Stringified with default: $dt";

Someone came up to me at OSCON and asked about whether I wanted a patch
for this and I said yes.  I think it might've been Michael Schwern.

> again. Maybe these should be in DateTime::Format::Business.
>
> $biz = new DateTime::Format::Business(
>       %monday_to_friday_nine_to_five
> )
> $dt2 = $biz->tomorrow( DateTime->now );
> Then when you're open M-F and you ask for tomorrow() on a Friday, you
> get Monday.

This is orthogonal to whether or not those constructor end up in
DateTime.pm, I think.  That said, the functionalityy you're proposing
would no doubt be useful for many people.  I think it'd belong in
DateTime::Fiscal, though.  It's not really a format, so much as a way of
handling complex sets and doing date math on elements of the set (eerr,
does that make sense?).


-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

Reply via email to