From 71d27de3c9644890cb4967c908620f53003da35c Mon Sep 17 00:00:00 2001 From: Negatifff Date: Tue, 18 Aug 2020 19:18:54 +0300 Subject: [PATCH] Convert LastSync date for oxidized config info (#11779) * Convert LastSync date for oxidized config info. Add format in settings. * commas and spaces fix * commas and spaces fix2 * fixed time if oxidized returned null * commas and spaces fix * datetime format fix * UTC is already in the string Co-authored-by: Tony Murray --- includes/html/pages/device/showconfig.inc.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/includes/html/pages/device/showconfig.inc.php b/includes/html/pages/device/showconfig.inc.php index e7cbaff524..16114cf854 100644 --- a/includes/html/pages/device/showconfig.inc.php +++ b/includes/html/pages/device/showconfig.inc.php @@ -132,6 +132,12 @@ if (Auth::user()->hasGlobalAdmin()) { // fetch info about the node and then a list of versions for that node $node_info = json_decode(file_get_contents(Config::get('oxidized.url') . '/node/show/' . $oxidized_hostname . '?format=json'), true); + if (!empty($node_info['last']['start'])) { + $node_info['last']['start']=date(Config::get('dateformat.long'), strtotime($node_info['last']['start'])); + } + if (!empty($node_info['last']['end'])) { + $node_info['last']['end']=date(Config::get('dateformat.long'), strtotime($node_info['last']['end'])); + } // Try other hostname format if Oxidized request failed if (! $node_info) { // Adjust hostname based on whether domain was already in it or not