PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Date and Time » Date » Bug #353

Date_Calc::beginOfNextWeek does not keep formatting

Details

Submitted2003-12-04 10:01 UTC
Fromb dot m dot d dot scott at herts dot ac dot uk
Assignedpajoye
StatusClosed
PackageDate
PHP Version4.3.3
OSwindows
Roadmaps(Not assigned)

Comments

[2003-12-04 10:01 UTC] b dot m dot d dot scott at herts dot ac dot uk

Description:
------------
when BeginOfNextWeek is called no matter what format you pass it will always return a date in the format %Y%m%d.
I think that this is because of the way that the date is passed to beginOfWeek:
return Date_Calc::beginOfWeek(
$next_week_day,$next_week_month,$next_week_year
);

It is missing the format part so when it is changed to:
return Date_Calc::beginOfWeek(
$next_week_day,$next_week_month,$next_week_year,$format
);
It works.

Reproduce code:
---------------
$tdate=Date_Calc::beginOfNextWeek('4','11','2003','%Y-%m-%d');
print $tdate;

Expected result:
----------------
2003-11-08

Actual result:
--------------
20031108