Skip to content
Extraits de code Groupes Projets
Valider c1f3f9c3 rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

fix expected date for auckland / new zealand was wrong

parent f82bf3c9
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -138,12 +138,15 @@ abstract class ScheduledTime
$dateInTimezone = Date::factory($arbitraryDateInUTC, $this->timezone);
$midnightInTimezone = date('H', $dateInTimezone->getTimestamp());
$hoursDifference = (24 - $midnightInTimezone) % 24;
if ($arbitraryDateInUTC->isEarlier($dateInTimezone)) {
$hoursDifference = -1 * $hoursDifference;
$hoursDifference = 0 - $midnightInTimezone;
} else {
$hoursDifference = 24 - $midnightInTimezone;
}
$hoursDifference = $hoursDifference % 24;
$rescheduledTime += (3600 * $hoursDifference);
if ($this->getTime() > $rescheduledTime) {
......
......@@ -101,7 +101,7 @@ class ScheduledTime_DailyTest extends PHPUnit_Framework_TestCase
$mock->setTimezone('Pacific/Auckland');
$timeAuckland = $mock->getRescheduledTime();
$this->assertEquals(-11 * $oneHourInSeconds, $timeAuckland - $timeUTC);
$this->assertEquals(-13 * $oneHourInSeconds, $timeAuckland - $timeUTC);
$mock->setTimezone('America/Los_Angeles');
......
......@@ -112,7 +112,7 @@ class ScheduledTime_MonthlyTest extends PHPUnit_Framework_TestCase
$mock->setTimezone('Pacific/Auckland');
$timeAuckland = $mock->getRescheduledTime();
$this->assertEquals(-11 * $oneHourInSeconds, $timeAuckland - $timeUTC);
$this->assertEquals(-13 * $oneHourInSeconds, $timeAuckland - $timeUTC);
$mock->setTimezone('America/Los_Angeles');
......
......@@ -148,7 +148,7 @@ class ScheduledTime_WeeklyTest extends PHPUnit_Framework_TestCase
$mock->setTimezone('Pacific/Auckland');
$timeAuckland = $mock->getRescheduledTime();
$this->assertEquals(-11 * $oneHourInSeconds, $timeAuckland - $timeUTC);
$this->assertEquals(-13 * $oneHourInSeconds, $timeAuckland - $timeUTC);
$mock->setTimezone('America/Los_Angeles');
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter