PM-4241 Añadir un flag en el endpoint /light/config para multi timezone

This commit is contained in:
Ronald Quenta
2015-11-30 15:38:41 -04:00
parent 3a9c268f48
commit 678e59b283

View File

@@ -1246,9 +1246,11 @@ class Light
*/ */
public function getConfiguration() public function getConfiguration()
{ {
$sysConf = \System::getSystemConfiguration( PATH_CONFIG . 'env.ini' ); $sysConf = \System::getSystemConfiguration('', '', SYS_SYS);
$offset = timezone_offset_get( new \DateTimeZone( $sysConf['time_zone'] ), new \DateTime() ); $offset = timezone_offset_get( new \DateTimeZone( $sysConf['time_zone'] ), new \DateTime() );
$response['timeZone'] = sprintf( "GMT%s%02d:%02d", ( $offset >= 0 ) ? '+' : '-', abs( $offset / 3600 ), abs( ($offset % 3600) / 60 ) ); $response['timeZone'] = sprintf( "GMT%s%02d:%02d", ( $offset >= 0 ) ? '+' : '-', abs( $offset / 3600 ), abs( ($offset % 3600) / 60 ) );
$response['multiTimeZone'] = (isset($sysConf['system_utc_time_zone']) && $sysConf['system_utc_time_zone'])
?true:false;
$fields = \System::getSysInfo(); $fields = \System::getSysInfo();
$response['version'] = $fields['PM_VERSION']; $response['version'] = $fields['PM_VERSION'];