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, '.']; }