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


PHP Localization::setDateFormat方法代码示例

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


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

示例1: DateTimeValue

 /**
 * Return formated date
 *
 * @access public
 * @param DateTimeValue $value If value is not instance of DateTime object new DateTime
 *   object will be created with $value as its constructor param
 * @param string $format If $format is NULL default date format will be used
 * @param float $timezone Timezone, if NULL it will be autodetected (by currently logged user if we have it)
 * @return string
 */
 function format_date($value = null, $format = null, $timezone = null) {
   if(is_null($timezone) && function_exists('logged_user') && (logged_user() instanceof Contact)) {
     $timezone = logged_user()->getTimezone();
   } // if
   $datetime = $value instanceof DateTimeValue ? $value : new DateTimeValue($value);
   if ($format){
   	$l = new Localization();
   	$l->setDateFormat($format);
   }else
   	$l = Localization::instance();
   return $l->formatDate($datetime, $timezone);
 } // format_date
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:22,代码来源:format.php

示例2: clean

                    $alldayevents[$task->getId()] = $task;
                }
                $added = true;
            }
        }
    }
}
if (is_array($birthdays)) {
    $alldayevents = array_merge($alldayevents, $birthdays);
}
$alldaygridHeight = count($alldayevents) * PX_HEIGHT / 2 + PX_HEIGHT / 3;
if ($alldaygridHeight > 150) {
    $alldaygridHeight = 150;
}
$loc = new Localization();
$loc->setDateFormat(lang('view date title', $date_format));
$view_title = $loc->formatDate($dtv);
// lang(strtolower(date('l', $dtv))) . date(' j, ', $dtv) . lang('month ' . date('n', $dtv)) . date(' Y', $dtv);
$users_array = array();
$companies_array = array();
foreach ($users as $u) {
    $users_array[] = $u->getArrayInfo();
}
foreach ($companies as $company) {
    $companies_array[] = $company->getArrayInfo();
}
?>
<div id="calHiddenFields">
	<input type="hidden" id="hfCalUsers" value="<?php 
echo clean(str_replace('"', "'", escape_character(json_encode($users_array))));
?>
开发者ID:abhinay100,项目名称:fengoffice_app,代码行数:31,代码来源:viewdate.php

示例3: clean

        if ($task->getDueDate() instanceof DateTimeValue && $dtv->getTimestamp() == mktime(0, 0, 0, $task->getDueDate()->getMonth(), $task->getDueDate()->getDay(), $task->getDueDate()->getYear())) {
            continue;
        }
        if ($task->getStartDate() instanceof DateTimeValue && $dtv->getTimestamp() == mktime(0, 0, 0, $task->getStartDate()->getMonth(), $task->getStartDate()->getDay(), $task->getStartDate()->getYear())) {
            continue;
        }
        unset($tmp_tasks[$k]);
    }
    $alldayevents = array_merge($alldayevents, $tmp_tasks);
}
if (is_array($birthdays)) {
    $alldayevents = array_merge($alldayevents, $birthdays);
}
$alldaygridHeight = count($alldayevents) * PX_HEIGHT / 2 + PX_HEIGHT / 3;
$loc = new Localization();
$loc->setDateFormat(lang('view date title'));
$view_title = $loc->formatDate($dtv);
// lang(strtolower(date('l', $dtv))) . date(' j, ', $dtv) . lang('month ' . date('n', $dtv)) . date(' Y', $dtv);
$users_array = array();
$companies_array = array();
foreach ($users as $u) {
    $users_array[] = $u->getArrayInfo();
}
foreach ($companies as $company) {
    $companies_array[] = $company->getArrayInfo();
}
?>
<div id="calHiddenFields">
	<input type="hidden" id="hfCalUsers" value="<?php 
echo clean(str_replace('"', "'", str_replace("'", "\\'", json_encode($users_array))));
?>
开发者ID:pnagaraju25,项目名称:fengoffice,代码行数:31,代码来源:viewdate.php


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