|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.util.JiraDurationUtils.PrettyDurationFormatter
public static class JiraDurationUtils.PrettyDurationFormatter
This formatter formats time duration to "pretty" format, such as 3 weeks, 2 days, 1 hour, 15 minutes. This value is formatted according to system or user's locale.
Field Summary | |
---|---|
static String |
KEY_FORMAT_PRETTY
|
Constructor Summary | |
---|---|
JiraDurationUtils.PrettyDurationFormatter(BigDecimal hoursPerDay,
BigDecimal daysPerWeek,
I18nHelper i18nBean)
|
|
JiraDurationUtils.PrettyDurationFormatter(int hoursPerDay,
int daysPerWeek,
I18nHelper i18nBean)
|
Method Summary | |
---|---|
String |
format(Long duration)
Formats a given time duration with default (system) locale. |
String |
format(Long duration,
Locale locale)
Formats a given time duration with given locale. |
BigDecimal |
getDaysPerWeek()
|
BigDecimal |
getHoursPerDay()
|
String |
getI18nKey()
|
String |
shortFormat(Long duration)
Used by the Time Tracking report to show shorter durations than full pretty format. |
String |
shortFormat(Long duration,
Locale locale)
Formats a given time duration with the given locale in the most compact way possible |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String KEY_FORMAT_PRETTY
Constructor Detail |
---|
public JiraDurationUtils.PrettyDurationFormatter(int hoursPerDay, int daysPerWeek, I18nHelper i18nBean)
public JiraDurationUtils.PrettyDurationFormatter(BigDecimal hoursPerDay, BigDecimal daysPerWeek, I18nHelper i18nBean)
Method Detail |
---|
public String getI18nKey()
getI18nKey
in interface JiraDurationUtils.DurationFormatter
public String format(Long duration)
JiraDurationUtils.DurationFormatter
format
in interface JiraDurationUtils.DurationFormatter
duration
- time duration to format
public String format(Long duration, Locale locale)
JiraDurationUtils.DurationFormatter
format
in interface JiraDurationUtils.DurationFormatter
duration
- time duration to formatlocale
- user's locale
public String shortFormat(Long duration)
shortFormat
in interface JiraDurationUtils.DurationFormatter
duration
- time duration to format
public String shortFormat(Long duration, Locale locale)
JiraDurationUtils.DurationFormatter
shortFormat
in interface JiraDurationUtils.DurationFormatter
duration
- time duration in secondslocale
- locale to use
public BigDecimal getHoursPerDay()
public BigDecimal getDaysPerWeek()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |