PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Date and Time » Calendar » Bug #3445

bug in Calendar_Week::thisWeek()

Details

Submitted2005-02-12 18:10 UTC
Fromwolfpak at cyberverse dot com
Assignedquipo
StatusClosed
PackageCalendar
PHP Version4.3.10
OSIrrelevant
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