當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DateTimeUtil::isLocaleTimeDisplayedAs12Hours方法代碼示例

本文整理匯總了PHP中DateTimeUtil::isLocaleTimeDisplayedAs12Hours方法的典型用法代碼示例。如果您正苦於以下問題:PHP DateTimeUtil::isLocaleTimeDisplayedAs12Hours方法的具體用法?PHP DateTimeUtil::isLocaleTimeDisplayedAs12Hours怎麽用?PHP DateTimeUtil::isLocaleTimeDisplayedAs12Hours使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DateTimeUtil的用法示例。


在下文中一共展示了DateTimeUtil::isLocaleTimeDisplayedAs12Hours方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: renderControlEditable

 /**
  * Render a datetime JUI widget
  * @return The element's content as a string.
  */
 protected function renderControlEditable()
 {
     $themePath = Yii::app()->baseUrl . '/themes/' . Yii::app()->theme->name;
     $value = DateTimeUtil::convertDbFormattedDateTimeToLocaleFormattedDisplay($this->model->{$this->attribute});
     $cClipWidget = new CClipWidget();
     $cClipWidget->beginClip("EditableDateTimeElement");
     $cClipWidget->widget('application.extensions.timepicker.EJuiDateTimePicker', array('attribute' => $this->attribute, 'language' => YiiToJqueryUIDatePickerLocalization::getLanguage(), 'value' => $value, 'htmlOptions' => array('id' => $this->getEditableInputId(), 'name' => $this->getEditableInputName(), 'style' => 'position:relative;z-index:10000;'), 'options' => array('stepMinute' => 5, 'timeText' => Yii::t('Default', 'Time'), 'hourText' => Yii::t('Default', 'Hour'), 'minuteText' => Yii::t('Default', 'Minute'), 'secondText' => Yii::t('Default', 'Second'), 'currentText' => Yii::t('Default', 'Now'), 'closeText' => Yii::t('Default', 'Done'), 'showOn' => 'both', 'buttonImageOnly' => false, 'buttonText' => ZurmoHtml::tag('span', array(), '<!--Date-->'), 'dateFormat' => YiiToJqueryUIDatePickerLocalization::resolveDateFormat(DateTimeUtil::getLocaleDateFormat()), 'timeFormat' => YiiToJqueryUIDatePickerLocalization::resolveTimeFormat(DateTimeUtil::getLocaleTimeFormat()), 'ampm' => DateTimeUtil::isLocaleTimeDisplayedAs12Hours())));
     $cClipWidget->endClip();
     $content = $cClipWidget->getController()->clips['EditableDateTimeElement'];
     return ZurmoHtml::tag('div', array('class' => 'has-date-select'), $content);
 }
開發者ID:youprofit,項目名稱:Zurmo,代碼行數:15,代碼來源:DateTimeElement.php

示例2: testIsLocaleTimeDisplayedAs12Hours

 public function testIsLocaleTimeDisplayedAs12Hours()
 {
     $language = Yii::app()->getLanguage();
     $this->assertEquals($language, 'en');
     $this->assertTrue(DateTimeUtil::isLocaleTimeDisplayedAs12Hours());
     Yii::app()->setLanguage('de');
     $this->assertFalse(DateTimeUtil::isLocaleTimeDisplayedAs12Hours());
     Yii::app()->setLanguage('fr');
     $this->assertFalse(DateTimeUtil::isLocaleTimeDisplayedAs12Hours());
     Yii::app()->setLanguage('it');
     $this->assertFalse(DateTimeUtil::isLocaleTimeDisplayedAs12Hours());
     Yii::app()->setLanguage('es');
     $this->assertFalse(DateTimeUtil::isLocaleTimeDisplayedAs12Hours());
 }
開發者ID:youprofit,項目名稱:Zurmo,代碼行數:14,代碼來源:DateTimeUtilTest.php

示例3: resolveDefaultOptions

 protected function resolveDefaultOptions()
 {
     $this->options['stepMinute'] = 5;
     $this->options['timeText'] = Zurmo::t('Core', 'Time');
     $this->options['hourText'] = Zurmo::t('Core', 'Hour');
     $this->options['minuteText'] = Zurmo::t('Core', 'Minute');
     $this->options['secondText'] = Zurmo::t('Core', 'Second');
     $this->options['showOn'] = 'both';
     $this->options['buttonText'] = ZurmoHtml::tag('span', array(), '<!--Date-->');
     $this->options['buttonImageOnly'] = false;
     $this->options['dateFormat'] = YiiToJqueryUIDatePickerLocalization::resolveDateFormat(DateTimeUtil::getLocaleDateFormat());
     $this->options['timeFormat'] = YiiToJqueryUIDatePickerLocalization::resolveTimeFormat(DateTimeUtil::getLocaleTimeFormat());
     $this->options['ampm'] = DateTimeUtil::isLocaleTimeDisplayedAs12Hours();
 }
開發者ID:sandeep1027,項目名稱:zurmo_,代碼行數:14,代碼來源:ZurmoJuiDateTimePicker.php


注:本文中的DateTimeUtil::isLocaleTimeDisplayedAs12Hours方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。