From 183937b8e9aa82e25cedb3f9a1e034d7ec700a6f Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 3 Aug 2012 16:18:45 -0400 Subject: [PATCH] CC-1665: Scheduled stream rebroadcasting and recording -when editing string should hav 00h 00m format. --- airtime_mvc/application/models/Webstream.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/airtime_mvc/application/models/Webstream.php b/airtime_mvc/application/models/Webstream.php index 6eba67789..cfb1f33d1 100644 --- a/airtime_mvc/application/models/Webstream.php +++ b/airtime_mvc/application/models/Webstream.php @@ -39,7 +39,14 @@ class Application_Model_Webstream{ public function getDefaultLength() { - return $this->webstream->getDbLength(); + $dateString = $this->webstream->getDbLength(); + $arr = explode(":", $dateString); + if (count($arr) == 3) { + list($hours, $min, $sec) = $arr; + $di = new DateInterval("PT{$hours}H{$min}M{$sec}S"); + return $di->format("%Hh %im"); + } + return ""; } public function getDescription()