当前位置: 首页>>代码示例>>PHP>>正文


PHP DateHelper::removeSecondsFromTime方法代码示例

本文整理汇总了PHP中DateHelper::removeSecondsFromTime方法的典型用法代码示例。如果您正苦于以下问题:PHP DateHelper::removeSecondsFromTime方法的具体用法?PHP DateHelper::removeSecondsFromTime怎么用?PHP DateHelper::removeSecondsFromTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DateHelper的用法示例。


在下文中一共展示了DateHelper::removeSecondsFromTime方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: editShowAction

 public function editShowAction()
 {
     $userInfo = Zend_Auth::getInstance()->getStorage()->read();
     $user = new User($userInfo->id);
     if (!$user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER))) {
         return;
     }
     $showInstanceId = $this->_getParam('id');
     $formWhat = new Application_Form_AddShowWhat();
     $formWho = new Application_Form_AddShowWho();
     $formWhen = new Application_Form_AddShowWhen();
     $formRepeats = new Application_Form_AddShowRepeats();
     $formStyle = new Application_Form_AddShowStyle();
     $formRecord = new Application_Form_AddShowRR();
     $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates();
     $formRebroadcast = new Application_Form_AddShowRebroadcastDates();
     $formWhat->removeDecorator('DtDdWrapper');
     $formWho->removeDecorator('DtDdWrapper');
     $formWhen->removeDecorator('DtDdWrapper');
     $formRepeats->removeDecorator('DtDdWrapper');
     $formStyle->removeDecorator('DtDdWrapper');
     $formRecord->removeDecorator('DtDdWrapper');
     $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper');
     $formRebroadcast->removeDecorator('DtDdWrapper');
     $this->view->what = $formWhat;
     $this->view->when = $formWhen;
     $this->view->repeats = $formRepeats;
     $this->view->who = $formWho;
     $this->view->style = $formStyle;
     $this->view->rr = $formRecord;
     $this->view->absoluteRebroadcast = $formAbsoluteRebroadcast;
     $this->view->rebroadcast = $formRebroadcast;
     $this->view->addNewShow = false;
     $showInstance = new ShowInstance($showInstanceId);
     $show = new Show($showInstance->getShowId());
     $formWhat->populate(array('add_show_id' => $show->getId(), 'add_show_name' => $show->getName(), 'add_show_url' => $show->getUrl(), 'add_show_genre' => $show->getGenre(), 'add_show_description' => $show->getDescription()));
     $formWhen->populate(array('add_show_start_date' => $show->getStartDate(), 'add_show_start_time' => DateHelper::removeSecondsFromTime($show->getStartTime()), 'add_show_end_date_no_repeat' => $show->getEndDate(), 'add_show_end_time' => DateHelper::removeSecondsFromTime($show->getEndTime()), 'add_show_duration' => $show->getDuration(true), 'add_show_repeats' => $show->isRepeating() ? 1 : 0));
     if ($show->isStartDateTimeInPast()) {
         $formWhen->getElement('add_show_start_date')->setOptions(array('disabled' => true));
     }
     $days = array();
     $showDays = CcShowDaysQuery::create()->filterByDbShowId($showInstance->getShowId())->find();
     foreach ($showDays as $showDay) {
         array_push($days, $showDay->getDbDay());
     }
     $displayedEndDate = new DateTime($show->getRepeatingEndDate());
     $displayedEndDate->sub(new DateInterval("P1D"));
     //end dates are stored non-inclusively.
     $displayedEndDate = $displayedEndDate->format("Y-m-d");
     $formRepeats->populate(array('add_show_repeat_type' => $show->getRepeatType(), 'add_show_day_check' => $days, 'add_show_end_date' => $displayedEndDate, 'add_show_no_end' => $show->getRepeatingEndDate() == ''));
     $formRecord->populate(array('add_show_record' => $show->isRecorded(), 'add_show_rebroadcast' => $show->isRebroadcast()));
     $formRecord->getElement('add_show_record')->setOptions(array('disabled' => true));
     $rebroadcastsRelative = $show->getRebroadcastsRelative();
     $rebroadcastFormValues = array();
     $i = 1;
     foreach ($rebroadcastsRelative as $rebroadcast) {
         $rebroadcastFormValues["add_show_rebroadcast_date_{$i}"] = $rebroadcast['day_offset'];
         $rebroadcastFormValues["add_show_rebroadcast_time_{$i}"] = DateHelper::removeSecondsFromTime($rebroadcast['start_time']);
         $i++;
     }
     $formRebroadcast->populate($rebroadcastFormValues);
     $rebroadcastsAbsolute = $show->getRebroadcastsAbsolute();
     $rebroadcastAbsoluteFormValues = array();
     $i = 1;
     foreach ($rebroadcastsAbsolute as $rebroadcast) {
         $rebroadcastAbsoluteFormValues["add_show_rebroadcast_date_absolute_{$i}"] = $rebroadcast['start_date'];
         $rebroadcastAbsoluteFormValues["add_show_rebroadcast_time_absolute_{$i}"] = DateHelper::removeSecondsFromTime($rebroadcast['start_time']);
         $i++;
     }
     $formAbsoluteRebroadcast->populate($rebroadcastAbsoluteFormValues);
     $hosts = array();
     $showHosts = CcShowHostsQuery::create()->filterByDbShow($showInstance->getShowId())->find();
     foreach ($showHosts as $showHost) {
         array_push($hosts, $showHost->getDbHost());
     }
     $formWho->populate(array('add_show_hosts' => $hosts));
     $formStyle->populate(array('add_show_background_color' => $show->getBackgroundColor(), 'add_show_color' => $show->getColor()));
     $this->view->newForm = $this->view->render('schedule/add-show-form.phtml');
     $this->view->entries = 5;
 }
开发者ID:romansavrulin,项目名称:Airtime,代码行数:80,代码来源:ScheduleController.php


注:本文中的DateHelper::removeSecondsFromTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。