Home » Date and Time » Calendar » Bug #3445
bug in Calendar_Week::thisWeek()
Details
| Submitted | 2005-02-12 18:10 UTC |
|---|---|
| From | wolfpak at cyberverse dot com |
| Assigned | quipo |
| Status | Closed |
| Package | Calendar |
| PHP Version | 4.3.10 |
| OS | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2005-02-12 18:10 UTC] wolfpak at cyberverse dot com
Description:
------------
Package Version: 0.5.2
I'm calling the thisWeek() method on a Calendar_Week object where the first arg is 'n_in_month' and the date supplied to the Calendar_Week constructor is in the first week of any month.
I expected the return value to be 1 to indicate the first week in the month.
What I actually get is the LAST week # in the month.
Reproduce code:
---------------
<?php
require_once('Calendar/Week.php');
$week = &new Calendar_Week(2005, 2, 3, 0);
$n_in_month = $week->thisWeek('n_in_month');
print "Week # in month: $n_in_month\n";
?>
The patch I created can be downloaded here:
http://wolfpak.home.die.net/Calendar_Week-0.5.2-thisWeek.patch
Expected result:
----------------
Week # in month: 1
Actual result:
--------------
Week # in month: 6