com.atlassian.jira.datetime
Class DateVelocityUtils

java.lang.Object
  extended by com.atlassian.jira.datetime.DateVelocityUtils

@Immutable
public class DateVelocityUtils
extends Object

Aggregates the most commonly-used date formats in a single instance, for use within Velocity templates. All strings returned by this class are in the system time zone, and are either HTML- or XML-escaped (as appropriate).

Since:
v5.0

Constructor Summary
DateVelocityUtils(DateTimeFormatter dateTimeFormatter)
           
 
Method Summary
 String formatRelative(Date date)
          Returns a string representation of the given date in DateTimeStyle#RELATIVE_WITHOUT_TIME format.
 String formatRSS(Date date)
          Returns a string representation of the given date in DateTimeStyle#RSS_RFC822_DATE_TIME format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateVelocityUtils

public DateVelocityUtils(DateTimeFormatter dateTimeFormatter)
Method Detail

formatRelative

public String formatRelative(Date date)
Returns a string representation of the given date in DateTimeStyle#RELATIVE_WITHOUT_TIME format.

Parameters:
date - a date/time to format
Returns:
an string containing the given date/time (HTML-escaped)

formatRSS

public String formatRSS(Date date)
Returns a string representation of the given date in DateTimeStyle#RSS_RFC822_DATE_TIME format.

Parameters:
date - a date/time to format
Returns:
an string containing the given date/time (XML-escaped)


Copyright © 2002-2014 Atlassian. All Rights Reserved.