cvs: pear /Calendar Week.php
| From: | Lorenzo Alberton | Date: | Sat, 22 Oct 2005 10:26:49 +0000 |
| Subject: | cvs: pear /Calendar Week.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-35784@lists.php.net to get a copy of this message | ||
quipo Sat Oct 22 06:26:49 2005 EDT
Modified files:
/pear/Calendar Week.php
Log:
use defineFirstDayOfWeek()
$firstDay parameter now defaults to NULL for consistency
http://cvs.php.net/diff.php/pear/Calendar/Week.php?r1=1.6&r2=1.7&ty=u
Index: pear/Calendar/Week.php
diff -u pear/Calendar/Week.php:1.6 pear/Calendar/Week.php:1.7
--- pear/Calendar/Week.php:1.6 Thu Oct 20 14:51:32 2005
+++ pear/Calendar/Week.php Sat Oct 22 06:26:49 2005
@@ -18,11 +18,11 @@
// | Lorenzo Alberton <l dot alberton at quipo dot it> |
// +----------------------------------------------------------------------+
//
-// $Id: Week.php,v 1.6 2005/10/20 18:51:32 quipo Exp $
+// $Id: Week.php,v 1.7 2005/10/22 10:26:49 quipo Exp $
//
/**
* @package Calendar
- * @version $Id: Week.php,v 1.6 2005/10/20 18:51:32 quipo Exp $
+ * @version $Id: Week.php,v 1.7 2005/10/22 10:26:49 quipo Exp $
*/
/**
@@ -115,23 +115,21 @@
* @param int (optional) first day of week (e.g. 0 for Sunday, 2 for Tuesday etc.)
* @access public
*/
- function Calendar_Week($y, $m, $d, $firstDay=false)
+ function Calendar_Week($y, $m, $d, $firstDay=null)
{
require_once CALENDAR_ROOT.'Table/Helper.php';
Calendar::Calendar($y, $m, $d);
- if ($firstDay !== false) {
- $this->firstDay = $firstDay;
- }
- $this->tableHelper = & new Calendar_Table_Helper($this, $firstDay);
- $this->thisWeek = $this->tableHelper->getWeekStart($y, $m, $d, $firstDay);
+ $this->firstDay = $this->defineFirstDayOfWeek($firstDay);
+ $this->tableHelper = & new Calendar_Table_Helper($this, $this->firstDay);
+ $this->thisWeek = $this->tableHelper->getWeekStart($y, $m, $d,
$this->firstDay);
$this->prevWeek = $this->tableHelper->getWeekStart($y, $m, $d -
$this->cE->getDaysInWeek(
$this->thisYear(),
$this->thisMonth(),
- $this->thisDay()), $firstDay);
+ $this->thisDay()), $this->firstDay);
$this->nextWeek = $this->tableHelper->getWeekStart($y, $m, $d +
$this->cE->getDaysInWeek(
$this->thisYear(),
$this->thisMonth(),
- $this->thisDay()), $firstDay);
+ $this->thisDay()), $this->firstDay);
}
/**
@@ -274,7 +272,7 @@
break;
case 'object':
require_once CALENDAR_ROOT.'Factory.php';
- return Calendar_Factory::createByTimestamp('Week',$this->prevWeek);
+ return Calendar_Factory::createByTimestamp('Week', $this->prevWeek);
break;
case 'timestamp':
default:
@@ -321,7 +319,7 @@
break;
case 'object':
require_once CALENDAR_ROOT.'Factory.php';
- return Calendar_Factory::createByTimestamp('Week',$this->thisWeek);
+ return Calendar_Factory::createByTimestamp('Week', $this->thisWeek);
break;
case 'timestamp':
default:
@@ -355,7 +353,7 @@
break;
case 'object':
require_once CALENDAR_ROOT.'Factory.php';
- return Calendar_Factory::createByTimestamp('Week',$this->nextWeek);
+ return Calendar_Factory::createByTimestamp('Week', $this->nextWeek);
break;
case 'timestamp':
default: