Example usage for com.liferay.portal.kernel.util FastDateFormatFactoryUtil getSimpleDateFormat

List of usage examples for com.liferay.portal.kernel.util FastDateFormatFactoryUtil getSimpleDateFormat

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util FastDateFormatFactoryUtil getSimpleDateFormat.

Prototype

public static Format getSimpleDateFormat(String pattern, TimeZone timeZone) 

Source Link

Usage

From source file:com.idetronic.subur.model.impl.SuburItemImpl.java

License:Open Source License

public String getPublishYear() {
    Format yearFormatDate = FastDateFormatFactoryUtil.getSimpleDateFormat("yyyy", getLocale(null));//, timeZone);

    if (Validator.isNotNull(getPublishedDate())) {
        return yearFormatDate.format(getPublishedDate());
    }//ww  w .  j a v a 2  s  . com
    return StringPool.BLANK;
}

From source file:com.liferay.content.targeting.rule.time.TimeRule.java

License:Open Source License

@Override
public String getSummary(RuleInstance ruleInstance, Locale locale) {
    String typeSettings = ruleInstance.getTypeSettings();

    Format format = FastDateFormatFactoryUtil.getSimpleDateFormat(_SIMPLE_DATE_FORMAT_PATTERN, locale);

    Calendar startCalendar = _getStartCalendar(typeSettings);
    Calendar endCalendar = _getEndCalendar(typeSettings);

    String summary = LanguageUtil.format(locale, "users-browsing-the-site-from-x-to-x",
            new Object[] { format.format(startCalendar.getTime()), format.format(endCalendar.getTime()) });

    return summary;
}

From source file:com.liferay.meeting.webex.request.GetMeetingSummariesMeetingRequestTranslator.java

License:Open Source License

protected void addDateScopeType(LstsummaryMeeting lstsummaryMeeting, Calendar startCalendar,
        Calendar endCalendar) {/*  w w  w  .j  av a 2  s  .  c  om*/

    DateScopeType dateScopeType = lstsummaryMeeting.addNewDateScope();

    Format format = FastDateFormatFactoryUtil.getSimpleDateFormat(WebExConstants.DATE_PATTERN,
            startCalendar.getTimeZone());

    dateScopeType.setStartDateEnd(format.format(endCalendar));
    dateScopeType.setStartDateStart(format.format(startCalendar));
}