From ec804ded1d4f0ad6f457d945efbdd3fd93230134 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 24 Jul 2017 18:52:19 +0200 Subject: [PATCH] Fixed timedate to 'Europe/Paris' --- build/viewer/view/history/view.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/build/viewer/view/history/view.php b/build/viewer/view/history/view.php index f6badbd..d9775fb 100755 --- a/build/viewer/view/history/view.php +++ b/build/viewer/view/history/view.php @@ -14,7 +14,8 @@ =========================================================*/ $loader = new \Twig_Loader_Filesystem(__BUILD__.'/viewer/view'); $twig = new \Twig_Environment($loader, []); - + $twig->getExtension('Twig_Extension_Core')->setTimezone('Europe/Paris'); + /* [2] Store variables =========================================================*/ @@ -70,7 +71,7 @@ } - + /* RETURNS A RELATIVE HUMAN-READABLE TIME * * @ts Timestamp to process @@ -106,20 +107,20 @@ $units['hour'] = intval(date('H')) - $units['hour']; $units['minute'] = intval(date('i')) - $units['minute']; $units['second'] = intval(date('s')) - $units['second']; - - + + /* [3] Return significative relative time =========================================================*/ /* (1) Date units */ - if( $units['year'] > 0 ) return [ $units['year'], 'Y' ]; - if( $units['month'] > 0 ) return [ $units['month'], 'm' ]; - if( $units['day'] > 0 ) return [ $units['day'], 'd' ]; + if( $units['year'] > 0 ) return [ $units['year'], 'Y' ]; + if( $units['month'] > 0 ) return [ $units['month'], 'm' ]; + if( $units['day'] > 0 ) return [ $units['day'], 'd' ]; /* (2) Time units */ - if( $units['hour'] > 0 ) return [ $units['hour'], 'H' ]; - if( $units['minute'] > 0 ) return [ $units['minute'], 'i' ]; - if( $units['second'] > 0 ) return [ $units['second'], 's' ]; - + if( $units['hour'] > 0 ) return [ $units['hour'], 'H' ]; + if( $units['minute'] > 0 ) return [ $units['minute'], 'i' ]; + if( $units['second'] > 0 ) return [ $units['second'], 's' ]; + /* (3) Default value */ return [0, '.']; }