Package com.atlassian.jira.util
Class JiraDurationUtils.PrettyDurationFormatter
java.lang.Object
com.atlassian.jira.util.JiraDurationUtils.PrettyDurationFormatter
- All Implemented Interfaces:
JiraDurationUtils.DurationFormatter
- Enclosing class:
JiraDurationUtils
public static class JiraDurationUtils.PrettyDurationFormatter
extends Object
implements JiraDurationUtils.DurationFormatter
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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPrettyDurationFormatter(int hoursPerDay, int daysPerWeek, I18nHelper i18nBean) PrettyDurationFormatter(BigDecimal hoursPerDay, BigDecimal daysPerWeek, I18nHelper i18nBean) -
Method Summary
Modifier and TypeMethodDescriptionFormats a given time duration with default (system) locale.Formats a given time duration with given locale.shortFormat(Long duration) Used by the Time Tracking report to show shorter durations than full pretty format.shortFormat(Long duration, Locale locale) Formats a given time duration with the given locale in the most compact way possible
-
Field Details
-
KEY_FORMAT_PRETTY
- See Also:
-
-
Constructor Details
-
PrettyDurationFormatter
-
PrettyDurationFormatter
-
-
Method Details
-
getI18nKey
- Specified by:
getI18nKeyin interfaceJiraDurationUtils.DurationFormatter
-
format
Description copied from interface:JiraDurationUtils.DurationFormatterFormats a given time duration with default (system) locale.- Specified by:
formatin interfaceJiraDurationUtils.DurationFormatter- Parameters:
duration- time duration to format- Returns:
- formatted time duration
-
format
Description copied from interface:JiraDurationUtils.DurationFormatterFormats a given time duration with given locale.- Specified by:
formatin interfaceJiraDurationUtils.DurationFormatter- Parameters:
duration- time duration to formatlocale- user's locale- Returns:
- formatted time duration
-
shortFormat
Used by the Time Tracking report to show shorter durations than full pretty format.- Specified by:
shortFormatin interfaceJiraDurationUtils.DurationFormatter- Parameters:
duration- time duration to format- Returns:
- a duration String in the format "1d 3h 30m".
-
shortFormat
Description copied from interface:JiraDurationUtils.DurationFormatterFormats a given time duration with the given locale in the most compact way possible- Specified by:
shortFormatin interfaceJiraDurationUtils.DurationFormatter- Parameters:
duration- time duration in secondslocale- locale to use- Returns:
- formatted time duration
-
getHoursPerDay
-
getDaysPerWeek
-