mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Unify time interval formatting (#14733)
* Unify time interval formatting Use carbon for formatting, it supports locales. * fix style * remove baseline exceptions * fixes found by lint
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Observers;
|
||||
|
||||
use App\Models\Eventlog;
|
||||
use App\Models\Stp;
|
||||
use LibreNMS\Util\Time;
|
||||
|
||||
class StpObserver
|
||||
{
|
||||
@@ -24,7 +25,7 @@ class StpObserver
|
||||
}
|
||||
|
||||
if ($stp->isDirty('rootPort')) {
|
||||
$time = \LibreNMS\Util\Time::formatInterval($stp->timeSinceTopologyChange);
|
||||
$time = Time::formatInterval((int) $stp->timeSinceTopologyChange);
|
||||
Eventlog::log('STP topology changed after: ' . $time, $stp->device_id, 'stp', 4);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user