From 5322527c65c567e36cf47fd941641e1deba172da Mon Sep 17 00:00:00 2001 From: mokaddem Date: Thu, 12 Sep 2019 12:54:38 +0200 Subject: [PATCH] fix: [decaying:simulation] Make sure every sightings have a rounded timestamp --- app/Model/DecayingModel.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Model/DecayingModel.php b/app/Model/DecayingModel.php index 154957c0f..5d3c9ab1c 100644 --- a/app/Model/DecayingModel.php +++ b/app/Model/DecayingModel.php @@ -449,10 +449,9 @@ class DecayingModel extends AppModel $sightings = $this->Sighting->listSightings($user, $attribute_id, 'attribute', false, 0, false); if (empty($sightings)) { $sightings = array(array('Sighting' => array('date_sighting' => $attribute['Attribute']['timestamp']))); // simulate a Sighting nonetheless - } else { - foreach ($sightings as $i => $sighting) { - $sightings[$i]['Sighting']['rounded_timestamp'] = $this->round_timestamp_to_hour($sighting['Sighting']['date_sighting']); - } + } + foreach ($sightings as $i => $sighting) { + $sightings[$i]['Sighting']['rounded_timestamp'] = $this->round_timestamp_to_hour($sighting['Sighting']['date_sighting']); } // get start time $start_time = $attribute['Attribute']['timestamp'];