From 2fac820fb90a6b9c5a712d2c3b478074158366e0 Mon Sep 17 00:00:00 2001 From: bergware Date: Fri, 29 Jul 2016 11:26:40 +0200 Subject: [PATCH] Display date as numeral in Parity history --- plugins/dynamix/include/ParityHistory.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/dynamix/include/ParityHistory.php b/plugins/dynamix/include/ParityHistory.php index 4336c2cf7..93e4b0e65 100644 --- a/plugins/dynamix/include/ParityHistory.php +++ b/plugins/dynamix/include/ParityHistory.php @@ -11,6 +11,8 @@ */ ?> '-01-',' Feb '=>'-02-',' Mar '=>'-03-',' Apr '=>'-04-',' May '=>'-05-',' Jun '=>'-06-',' Jul '=>'-07-',' Aug '=>'-08-',' Sep '=>'-09-',' Oct '=>'-10-',' Nov '=>'-11-',' Dec '=>'-12-']; + function plus($val, $word, $last) { return $val>0 ? (($val||$last)?($val.' '.$word.($last?'':', ')):'') : ''; } @@ -39,6 +41,7 @@ if (file_exists($log)) { while (($line = fgets($handle)) !== false) { list($date,$duration,$speed,$status) = explode('|',$line); if ($speed==0) $speed = 'Unavailable'; + $date = str_replace(' ',', ',strtr(str_replace(' ',' 0',$date),$month)); if ($duration>0||$status<>0) $list[] = "$date".my_duration($duration)."$speed".($status==0?'OK':($status==-4?'Canceled':$status)).""; } fclose($handle);