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