@Immutable public class

DateVelocityUtils

extends Object
java.lang.Object
   ↳ com.atlassian.jira.datetime.DateVelocityUtils

Class Overview

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).

Summary

Public Constructors
DateVelocityUtils(DateTimeFormatter dateTimeFormatter)
Public Methods
String formatRSS(Date date)
Returns a string representation of the given date in DateTimeStyle#RSS_RFC822_DATE_TIME format.
String formatRelative(Date date)
Returns a string representation of the given date in DateTimeStyle#RELATIVE_WITHOUT_TIME format.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public DateVelocityUtils (DateTimeFormatter dateTimeFormatter)

Public Methods

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)

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)