Re: Proposal for Date-class
| From: | Tomas V.V.Cox | Date: | Thu, 19 Jul 2001 17:07:13 +0000 |
| Subject: | Re: Proposal for Date-class | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-896@lists.php.net to get a copy of this message | ||
Hans Westerbeek wrote:
>
> Hi,
>
> I miss the relation with the Date_Calc class. Lots of the functionality
> and intelligence in that class is probably very useful for Date and
> DateTime classes...
>
Perhaps could be useful to build a glue system, something like:
$date->return('nextDay');
Internally it would call Date_Calc::nextDay() with appropiate params. So
you won't need to do ackward things like:
Date_Calc::nextDay($date->getDay(), $date->getMonth(),
$date->getYear());
But probably the most cool feature will be change Date_Calc methods to
accept a date in whatever format.
Date_Calc::setInput('iso'); // via GLOBALS like PEAR::setErrorHandling
$a = Date_Calc::nextDay('2001/07/24');
$a = Date_Calc::toTimestamp($a); //or also Date_Calc::setOuput()
Just an idea,
Tomas V.V.Cox
PD.- It could be nice if the Date_Calc could return the textual name of
days and months in many languages.