cvs: pear /Calendar Week.php
| From: | Lorenzo Alberton | Date: | Thu, 08 Jul 2004 10:14:48 +0000 |
| Subject: | cvs: pear /Calendar Week.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-21635@lists.php.net to get a copy of this message | ||
quipo Thu Jul 8 06:14:48 2004 EDT
Modified files:
/pear/Calendar Week.php
Log:
fix Week::setSelection() (thanks to tj-pear at drennan dot bc dot ca)
[bug #1798]
http://cvs.php.net/diff.php/pear/Calendar/Week.php?r1=1.1&r2=1.2&ty=u
Index: pear/Calendar/Week.php
diff -u pear/Calendar/Week.php:1.1 pear/Calendar/Week.php:1.2
--- pear/Calendar/Week.php:1.1 Mon May 24 18:25:42 2004
+++ pear/Calendar/Week.php Thu Jul 8 06:14:48 2004
@@ -18,11 +18,11 @@
// | Lorenzo Alberton <l dot alberton at quipo dot it> |
// +----------------------------------------------------------------------+
//
-// $Id: Week.php,v 1.1 2004/05/24 22:25:42 quipo Exp $
+// $Id: Week.php,v 1.2 2004/07/08 10:14:48 quipo Exp $
//
/**
* @package Calendar
- * @version $Id: Week.php,v 1.1 2004/05/24 22:25:42 quipo Exp $
+ * @version $Id: Week.php,v 1.2 2004/07/08 10:14:48 quipo Exp $
*/
/**
@@ -198,21 +198,17 @@
*/
function setSelection($sDates)
{
- foreach ($sDates as $sDate) {
- if ($this->thisYear() == $sDate->thisYear()
- && $this->thisMonth() == $sDate->thisMonth())
- {
- foreach ($this->children as $key => $child) {
- if ($child->thisDay() == $sDate->thisDay() &&
- $child->thisMonth() == $sDate->thisMonth()
- ) {
- $sDate->setSelected();
- $this->children[$key] = $sDate;
- }
- }
- }
- }
- reset($this->children);
+ foreach ($sDates as $sDate) {
+ foreach ($this->children as $key => $child) {
+ if ($child->thisDay() == $sDate->thisDay() &&
+ $child->thisMonth() == $sDate->thisMonth() &&
+ $child->thisYear() == $sDate->thisYear()) {
+ $this->children[$key] = $sDate;
+ $this->children[$key]->setSelected();
+ }
+ }
+ }
+ reset($this->children);
}
/**