public class DateTimeFormatterFactoryStub extends Object implements DateTimeFormatterFactory
Constructor and Description |
---|
DateTimeFormatterFactoryStub() |
Modifier and Type | Method and Description |
---|---|
DateTimeFormatter |
formatter()
Creates a new DateTimeFormatter that uses the JIRA default time zone, locale, and
relative date style. |
DateTimeFormatterFactoryStub |
jiraLocale(Locale locale) |
DateTimeFormatterFactoryStub |
jiraTimeZone(org.joda.time.DateTimeZone timeZone) |
DateTimeFormatterFactoryStub |
relativeDates(boolean useRelativeDates) |
DateTimeFormatterFactoryStub |
style(DateTimeStyle style) |
DateTimeFormatterFactoryStub |
userLocale(Locale locale) |
DateTimeFormatterFactoryStub |
userTimeZone(org.joda.time.DateTimeZone timeZone) |
public DateTimeFormatterFactoryStub relativeDates(boolean useRelativeDates)
public DateTimeFormatterFactoryStub jiraTimeZone(org.joda.time.DateTimeZone timeZone)
public DateTimeFormatterFactoryStub userTimeZone(org.joda.time.DateTimeZone timeZone)
public DateTimeFormatterFactoryStub jiraLocale(Locale locale)
public DateTimeFormatterFactoryStub userLocale(Locale locale)
public DateTimeFormatterFactoryStub style(DateTimeStyle style)
public DateTimeFormatter formatter()
DateTimeFormatterFactory
relative
date style. To get a "smart" formatter that automatically uses the time zone and locale of the
currently logged in user, create a new formatter by calling DateTimeFormatter.forLoggedInUser()
on the formatter returned by this method, e.g.:
DateTimeFormatter userFormatter = dateTimeFormatterFactory.formatter().forLoggedInUser();Note that since JIRA 5.0 you can get a
DateTimeFormatter
injected directly into your class (in that case
there is no need to use this factory class).
A formatter obtained in this fashion may be safely reused across requests.
formatter
in interface DateTimeFormatterFactory
Copyright © 2002-2015 Atlassian. All Rights Reserved.