From 10fca7ca32b16d811ea2a3413ce26be007c294cf Mon Sep 17 00:00:00 2001 From: Peter Rotich <peter@osticket.com> Date: Wed, 22 Aug 2012 23:35:35 -0400 Subject: [PATCH] Reformat code for clarity --- include/class.format.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/include/class.format.php b/include/class.format.php index 9de1197ed..aaa6667d3 100644 --- a/include/class.format.php +++ b/include/class.format.php @@ -180,7 +180,7 @@ class Format { } /* elapsed time */ - function elapsedTime($sec){ + function elapsedTime($sec) { if(!$sec || !is_numeric($sec)) return ""; @@ -197,32 +197,32 @@ class Format { /* Dates helpers...most of this crap will change once we move to PHP 5*/ function db_date($time) { global $cfg; - return Format::userdate($cfg->getDateFormat(),Misc::db2gmtime($time)); + return Format::userdate($cfg->getDateFormat(), Misc::db2gmtime($time)); } function db_datetime($time) { global $cfg; - return Format::userdate($cfg->getDateTimeFormat(),Misc::db2gmtime($time)); + return Format::userdate($cfg->getDateTimeFormat(), Misc::db2gmtime($time)); } function db_daydatetime($time) { global $cfg; - return Format::userdate($cfg->getDayDateTimeFormat(),Misc::db2gmtime($time)); + return Format::userdate($cfg->getDayDateTimeFormat(), Misc::db2gmtime($time)); } - function userdate($format,$gmtime) { - return Format::date($format,$gmtime,$_SESSION['TZ_OFFSET'],$_SESSION['TZ_DST']); + function userdate($format, $gmtime) { + return Format::date($format, $gmtime, $_SESSION['TZ_OFFSET'], $_SESSION['TZ_DST']); } - function date($format,$gmtimestamp,$offset=0,$daylight=false){ - if(!$gmtimestamp || !is_numeric($gmtimestamp)) return ""; - - $offset+=$daylight?date('I',$gmtimestamp):0; //Daylight savings crap. - return date($format,($gmtimestamp+($offset*3600))); - } - + function date($format, $gmtimestamp, $offset=0, $daylight=false){ - - + if(!$gmtimestamp || !is_numeric($gmtimestamp)) + return ""; + + $offset+=$daylight?date('I', $gmtimestamp):0; //Daylight savings crap. + + return date($format, ($gmtimestamp+ ($offset*3600))); + } + } ?> -- GitLab