本文整理汇总了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);
}
示例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());
}
示例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();
}