CC-2336 Some Show Editing Features Seem to have been lost

recovered everything that original worked I think will keep looking,
still problems with editing a show which has already started.
This commit is contained in:
Naomi Aro 2011-05-30 12:24:39 -04:00
parent ab948b8dcb
commit f7de484461
6 changed files with 125 additions and 82 deletions

View file

@ -83,5 +83,40 @@ class DateHelper
return $hours.":".$minutes.":".$seconds.".".$ms;
}
/**
* This function formats a time by removing seconds
*
* When we receive a time from the database we get the
* format "hh:mm:ss". But when dealing with show times, we
* do not care about the seconds.
*
* @param int $p_timestamp
* The value which to format.
* @return int
* The timestamp with the new format "hh:mm", or
* the original input parameter, if it does not have
* the correct format.
*/
public static function removeSecondsFromTime($p_timestamp)
{
//Format is in hh:mm:ss. We want hh:mm
$timeExplode = explode(":", $p_timestamp);
if (count($timeExplode) == 3)
return $timeExplode[0].":".$timeExplode[1];
else
return $p_timestamp;
}
public static function getDateFromTimestamp($p_timestamp){
$explode = explode(" ", $p_timestamp);
return $explode[0];
}
public static function getTimeFromTimestamp($p_timestamp){
$explode = explode(" ", $p_timestamp);
return $explode[1];
}
}