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


PHP DateHelper::formatForLanguage方法代码示例

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


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

示例1: formatDate

 private function formatDate($dayOnly, $format)
 {
     $lang = new MockBaseLanguage();
     $lang->setReturnValue('getText', $format);
     $firstOfDecember2011_12_01 = 1322752769;
     return DateHelper::formatForLanguage($lang, $firstOfDecember2011_12_01, $dayOnly);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:DateHelperTest.php

示例2: getBodyText

 /**
  * Get the text body for notification
  *
  * @param Boolean $is_update    It is an update, not a new artifact
  * @param String  $recipient    The recipient who will receive the notification
  * @param BaseLanguage $language The language of the message
  * @param Boolean $ignore_perms indicates if permissions have to be ignored
  *
  * @return String
  */
 public function getBodyText($is_update, $recipient_user, BaseLanguage $language, $ignore_perms)
 {
     $format = 'text';
     $art = $this->getArtifact();
     $um = $this->getUserManager();
     $user = $um->getUserById($this->submitted_by);
     $output = '+============== ' . '[' . $art->getTracker()->getItemName() . ' #' . $art->getId() . '] ' . $art->fetchMailTitle($recipient_user, $format, $ignore_perms) . ' ==============+';
     $output .= PHP_EOL;
     $output .= PHP_EOL;
     $proto = $GLOBALS['sys_force_ssl'] ? 'https' : 'http';
     $output .= ' <' . $proto . '://' . $GLOBALS['sys_default_domain'] . TRACKER_BASE_URL . '/?aid=' . $art->getId() . '>';
     $output .= PHP_EOL;
     $output .= $language->getText('plugin_tracker_include_artifact', 'last_edited');
     $output .= ' ' . $this->getUserHelper()->getDisplayNameFromUserId($this->submitted_by);
     $output .= ' on ' . DateHelper::formatForLanguage($language, $this->submitted_on);
     if ($comment = $this->getComment()) {
         $output .= PHP_EOL;
         $output .= $comment->fetchMailFollowUp($format);
     }
     $output .= PHP_EOL;
     $output .= ' -------------- ' . $language->getText('plugin_tracker_artifact_changeset', 'header_changeset') . ' ---------------- ';
     $output .= PHP_EOL;
     $output .= $this->diffToPrevious($format, $recipient_user, $ignore_perms);
     $output .= PHP_EOL;
     $output .= ' -------------- ' . $language->getText('plugin_tracker_artifact_changeset', 'header_artifact') . ' ---------------- ';
     $output .= PHP_EOL;
     $output .= $art->fetchMail($recipient_user, $format, $ignore_perms);
     $output .= PHP_EOL;
     return $output;
 }
开发者ID:magarnier,项目名称:tuleap,代码行数:40,代码来源:Tracker_Artifact_Changeset.class.php

示例3: util_timestamp_to_userdateformat

/**
 * Convert a timestamp unix into the user defined format.
 * This format is depending on the choosen language, and is defined
 * in the site-content file <language>.tab
 *
 * @global $sys_datefmt the user preference date format defined in the language file
 *
 * @param string $date the date in the unix timestamp format
 * @param boolean $day_only false: return the day AND the time, true only the date.
 *
 * @deprecated Use DateHelper::formatForLanguage() instead
 *
 * @return string the date in the user format, or null if the conversion was not possible or wrong
 */
function util_timestamp_to_userdateformat($date, $day_only = false)
{
    return DateHelper::formatForLanguage($GLOBALS['Language'], $date, $day_only);
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:18,代码来源:utils.php


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