Hy,

As I said, I didn't convert my objet to a string, my code is the following

$today = new Fxc_Date_Public();
$nextDay = $today -> getNextWorkingDate();

public function getNextWorkingDate()
{
   $candidate = clone $this; // instead of $this -> getDate() which must
return a partial clone, according to the comments
   do
   {
       $candidate -> addDay(1);
   }while($candidate -> isPublic());

   return $candidate;
}

Ok...
I changed the code from you to work standalone:

<?php
require_once 'Zend/Date.php';

class Fxc_Date_Public extends Zend_Date {
public function getNextWorkingDate()
{
$candidate = clone $this; // instead of $this -> getDate() which must return a partial clone, according to the comments // $candidate = $this->getDate(); // Tried this line also but works the same way, no difference
   $candidate -> addDay(1);

   return $candidate;
}
}

$today = new Fxc_Date_Public();
print "<br>".$today->get(Zend_Date::ISO_8601);
print "<br>".$today->get(Zend_Date::YEAR);
$nextDay = $today -> getNextWorkingDate();
print "<br>".$nextDay->get(Zend_Date::ISO_8601);
print "<br>".$nextDay->get(Zend_Date::YEAR);

And I can not see the problem you mentioned.
I tried with your "clone" and also with "getDate()"... no difference.
Maybe you can chage my code above to produce the problem you got ??

Greetings
Thomas
I18N Team Leader

Reply via email to