Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattpiwik <matthieu.aubry@gmail.com>2010-07-25 20:31:08 +0400
committermattpiwik <matthieu.aubry@gmail.com>2010-07-25 20:31:08 +0400
commit0813d6cb53d139be7124c606a5c32e762f1029c1 (patch)
tree06159ec9f8d885bb897d1c436e3dc89a97ebcd96 /core/Date.php
parent2ac68498d4553d181d5be5b5906060cfafba33b4 (diff)
Hopefully now making sense in this method - looking forward to tests passing....
git-svn-id: http://dev.piwik.org/svn/trunk@2674 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'core/Date.php')
-rw-r--r--core/Date.php20
1 files changed, 17 insertions, 3 deletions
diff --git a/core/Date.php b/core/Date.php
index 71a088c4c1..45bd29d1a6 100644
--- a/core/Date.php
+++ b/core/Date.php
@@ -498,14 +498,28 @@ class Piwik_Date
$minutes = 0;
if($n != round($n))
{
- $minutes = abs($n - floor(abs($n))) * 60;
+ if($n >= 1 || $n <= -1)
+ {
+ $extraMinutes = floor(abs($n));
+ if($isNegative)
+ {
+ $extraMinutes = -$extraMinutes;
+ }
+ $minutes = abs($n - $extraMinutes) * 60;
+ if($isNegative) {
+ $minutes *= -1;
+ }
+ }
+ else
+ {
+ $minutes = $n * 60;
+ }
$n = floor(abs($n));
if($isNegative) {
- $minutes *= -1;
$n *= -1;
}
}
- $ts = $this->timestamp + $minutes * 60 + $n * 3600;
+ $ts = $this->timestamp + round($minutes * 60) + $n * 3600;
return new Piwik_Date( (int)$ts, $this->timezone );
}