Home » Date and Time » Date » Bug #353
Date_Calc::beginOfNextWeek does not keep formatting
Details
| Submitted | 2003-12-04 10:01 UTC |
|---|---|
| From | b dot m dot d dot scott at herts dot ac dot uk |
| Assigned | pajoye |
| Status | Closed |
| Package | Date |
| PHP Version | 4.3.3 |
| OS | windows |
| 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