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


Java DateFormatter类代码示例

本文整理汇总了Java中com.atlassian.confluence.core.DateFormatter的典型用法代码示例。如果您正苦于以下问题:Java DateFormatter类的具体用法?Java DateFormatter怎么用?Java DateFormatter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DateFormatter类属于com.atlassian.confluence.core包,在下文中一共展示了DateFormatter类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: newFriendlyDateFormatter

import com.atlassian.confluence.core.DateFormatter; //导入依赖的package包/类
protected FriendlyDateFormatter newFriendlyDateFormatter() {
	// Get current user's timezone, or default one
	User authUser = AuthenticatedUserThreadLocal.getUser();
	TimeZone timeZone;
	if (authUser == null) {
		// anonymous
		timeZone = TimeZone.getDefault();
	} else {
		ConfluenceUserPreferences prefs = userAccessor
				.getConfluenceUserPreferences(authUser);
		timeZone = prefs.getTimeZone();
	}
	// Build date formatter
	DateFormatter dateFormatter = new DateFormatter(timeZone,
			formatSettingsManager, localeManager);

	// Build "friendly" date formatter
	FriendlyDateFormatter friendlyDateFormatter = new FriendlyDateFormatter(
			new Date(), dateFormatter);
	return friendlyDateFormatter;
}
 
开发者ID:baloise,项目名称:dashboard-plus,代码行数:22,代码来源:StatusLightBasedMacro.java

示例2: generateDataset

import com.atlassian.confluence.core.DateFormatter; //导入依赖的package包/类
private CategoryDataset generateDataset()
{
	final DateFormatter dateFormatter = gpUtil.getUserPreferencesDateFormatter();

	final String successLabel = gpUtil.getText("greenpepper.historic.success");
	final String failuresLabel = gpUtil.getText("greenpepper.historic.failures");
	final String ignoredLabel = gpUtil.getText("greenpepper.historic.ignored");

	DefaultCategoryDataset dataset = new DefaultCategoryDataset();
	int count = executions.size();

	for (Execution exec : executions)
	{
		// Need to prefix with the count since we can have execution at the same time (formatDateTime is removing seconds!)
		String category = String.format("%2d. %s", count, dateFormatter.formatDateTime(exec.getExecutionDate()));

		if (!StringUtil.isEmpty(exec.getSections()))
		{
			category += "*";
		}

		ChartLongValue value = new ChartLongValue(category, exec.getId());

		double failureCount = exec.getErrors() + exec.getFailures()  + (exec.hasException() ? 1 : 0);

		dataset.addValue(new Double(exec.getSuccess()), successLabel, value);

		if (settings.isShowIgnored())
		{
			dataset.addValue(new Double(exec.getIgnored()), ignoredLabel, value);
		}

		dataset.addValue(new Double(failureCount), failuresLabel, value);

		count--;
	}

	return dataset;
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:40,代码来源:LinearExecutionChartBuilder.java

示例3: getUserPreferencesDateFormatter

import com.atlassian.confluence.core.DateFormatter; //导入依赖的package包/类
public DateFormatter getUserPreferencesDateFormatter()
{
	ConfluenceUserPreferences preferences = getUserAccessor().getConfluenceUserPreferences(getRemoteUser());

	return preferences.getDateFormatter(getFormatSettingsManager());
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:7,代码来源:ConfluenceGreenPepper.java

示例4: getUserPreferencesDateFormatter

import com.atlassian.confluence.core.DateFormatter; //导入依赖的package包/类
/**
 * <p>getUserPreferencesDateFormatter.</p>
 *
 * @return a {@link com.atlassian.confluence.core.DateFormatter} object.
 */
public DateFormatter getUserPreferencesDateFormatter() {
    ConfluenceUserPreferences preferences = getUserAccessor().getConfluenceUserPreferences(getRemoteUser());

    return preferences.getDateFormatter(getFormatSettingsManager());
}
 
开发者ID:strator-dev,项目名称:greenpepper,代码行数:11,代码来源:ConfluenceGreenPepper.java

示例5: getUserPreferencesDateFormatter

import com.atlassian.confluence.core.DateFormatter; //导入依赖的package包/类
public DateFormatter getUserPreferencesDateFormatter() {
    return getCustomizedPreferencesDateFormatter(getFormatSettingsManager());
}
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-confluence,代码行数:4,代码来源:LivingDocConfluenceManager.java

示例6: getCustomizedPreferencesDateFormatter

import com.atlassian.confluence.core.DateFormatter; //导入依赖的package包/类
public DateFormatter getCustomizedPreferencesDateFormatter(FormatSettingsManager formatSettingsManager) {
    ConfluenceUserPreferences preferences = getUserAccessor().getConfluenceUserPreferences(getRemoteUser());

    return preferences.getDateFormatter(formatSettingsManager, getLocaleManager());
}
 
开发者ID:testIT-LivingDoc,项目名称:livingdoc-confluence,代码行数:6,代码来源:LivingDocConfluenceManager.java


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