本文整理匯總了PHP中DateTimeUtil::getLocaleTimeFormat方法的典型用法代碼示例。如果您正苦於以下問題:PHP DateTimeUtil::getLocaleTimeFormat方法的具體用法?PHP DateTimeUtil::getLocaleTimeFormat怎麽用?PHP DateTimeUtil::getLocaleTimeFormat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DateTimeUtil
的用法示例。
在下文中一共展示了DateTimeUtil::getLocaleTimeFormat方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isLocaleTimeDisplayedAs12Hours
public static function isLocaleTimeDisplayedAs12Hours()
{
$timeFormat = DateTimeUtil::getLocaleTimeFormat();
if (strpos($timeFormat, 'H') === false) {
return true;
}
return false;
}
示例2: 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);
}
示例3: testGetLocaleFormats
public function testGetLocaleFormats()
{
$language = Yii::app()->getLanguage();
$this->assertEquals($language, 'en');
$this->assertEquals('M/d/yy h:mm a', DateTimeUtil::getLocaleDateTimeFormat());
$this->assertEquals('M/d/yy', DateTimeUtil::getLocaleDateFormat());
$this->assertEquals('h:mm a', DateTimeUtil::getLocaleTimeFormat());
Yii::app()->setLanguage('de');
$this->assertEquals('dd.MM.yy HH:mm', DateTimeUtil::getLocaleDateTimeFormat());
$this->assertEquals('dd.MM.yy', DateTimeUtil::getLocaleDateFormat());
$this->assertEquals('HH:mm', DateTimeUtil::getLocaleTimeFormat());
}
示例4: 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();
}
示例5: getTimeformat
protected function getTimeformat()
{
return $localeTimeFormat = YiiToJqueryUIDatePickerLocalization::resolveTimeFormat(DateTimeUtil::getLocaleTimeFormat());
}