From fbad1aaff345e98089db425b904551367b1f3028 Mon Sep 17 00:00:00 2001 From: mokaddem Date: Thu, 12 Sep 2019 11:49:50 +0200 Subject: [PATCH] chg: [decaying:simulation] Swapped round to floor when rounding sightings timestamp --- app/Model/DecayingModel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Model/DecayingModel.php b/app/Model/DecayingModel.php index 8a0e2b6cc..154957c0f 100644 --- a/app/Model/DecayingModel.php +++ b/app/Model/DecayingModel.php @@ -401,12 +401,12 @@ class DecayingModel extends AppModel } // returns timestamp set to the rounded hour - public function round_timestamp_to_hour($time, $closest=1) + public function round_timestamp_to_hour($time, $floor=1) { - if ($closest) { - return round((float) $time / 3600) * 3600; - } else { + if ($floor) { return floor((float) $time / 3600) * 3600; + } else { + return round((float) $time / 3600) * 3600; } }