chg: [decaying:simulation] Swapped round to floor when rounding

sightings timestamp
pull/5032/head
mokaddem 2019-09-12 11:49:50 +02:00
parent 1a5ab3e79e
commit fbad1aaff3
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 4 additions and 4 deletions

View File

@ -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;
}
}