Fixed timedate to 'Europe/Paris'
This commit is contained in:
parent
511d045362
commit
21c374b31f
|
@ -14,7 +14,8 @@
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
$loader = new \Twig_Loader_Filesystem(__BUILD__.'/viewer/view');
|
$loader = new \Twig_Loader_Filesystem(__BUILD__.'/viewer/view');
|
||||||
$twig = new \Twig_Environment($loader, []);
|
$twig = new \Twig_Environment($loader, []);
|
||||||
|
$twig->getExtension('Twig_Extension_Core')->setTimezone('Europe/Paris');
|
||||||
|
|
||||||
|
|
||||||
/* [2] Store variables
|
/* [2] Store variables
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
|
@ -70,7 +71,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* RETURNS A RELATIVE HUMAN-READABLE TIME
|
/* RETURNS A RELATIVE HUMAN-READABLE TIME
|
||||||
*
|
*
|
||||||
* @ts<int> Timestamp to process
|
* @ts<int> Timestamp to process
|
||||||
|
@ -106,20 +107,20 @@
|
||||||
$units['hour'] = intval(date('H')) - $units['hour'];
|
$units['hour'] = intval(date('H')) - $units['hour'];
|
||||||
$units['minute'] = intval(date('i')) - $units['minute'];
|
$units['minute'] = intval(date('i')) - $units['minute'];
|
||||||
$units['second'] = intval(date('s')) - $units['second'];
|
$units['second'] = intval(date('s')) - $units['second'];
|
||||||
|
|
||||||
|
|
||||||
/* [3] Return significative relative time
|
/* [3] Return significative relative time
|
||||||
=========================================================*/
|
=========================================================*/
|
||||||
/* (1) Date units */
|
/* (1) Date units */
|
||||||
if( $units['year'] > 0 ) return [ $units['year'], 'Y' ];
|
if( $units['year'] > 0 ) return [ $units['year'], 'Y' ];
|
||||||
if( $units['month'] > 0 ) return [ $units['month'], 'm' ];
|
if( $units['month'] > 0 ) return [ $units['month'], 'm' ];
|
||||||
if( $units['day'] > 0 ) return [ $units['day'], 'd' ];
|
if( $units['day'] > 0 ) return [ $units['day'], 'd' ];
|
||||||
|
|
||||||
/* (2) Time units */
|
/* (2) Time units */
|
||||||
if( $units['hour'] > 0 ) return [ $units['hour'], 'H' ];
|
if( $units['hour'] > 0 ) return [ $units['hour'], 'H' ];
|
||||||
if( $units['minute'] > 0 ) return [ $units['minute'], 'i' ];
|
if( $units['minute'] > 0 ) return [ $units['minute'], 'i' ];
|
||||||
if( $units['second'] > 0 ) return [ $units['second'], 's' ];
|
if( $units['second'] > 0 ) return [ $units['second'], 's' ];
|
||||||
|
|
||||||
/* (3) Default value */
|
/* (3) Default value */
|
||||||
return [0, '.'];
|
return [0, '.'];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue