Package com.atlassian.crowd.core.tiny
Class DateUtils
java.lang.Object
com.atlassian.crowd.core.tiny.DateUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformatDurationPretty
(long l) This is used by the Velocity templates as a beanstatic String
getDurationPretty
(long numSecs, Function<String, String> i18nResolver, boolean secondsResolution) static String
getDurationPrettySecondsResolution
(long numSecs, ResourceBundle resourceBundle) Converts a number of seconds into a pretty formatted data string.
-
Constructor Details
-
DateUtils
-
-
Method Details
-
getDurationPrettySecondsResolution
public static String getDurationPrettySecondsResolution(long numSecs, ResourceBundle resourceBundle) Converts a number of seconds into a pretty formatted data string. The resolution is in seconds.So for example
76
becomes'1 minute, 16 seconds'
, while42
becomes'42 seconds'
- Parameters:
numSecs
- the number of seconds in the durationresourceBundle
- a resouce bundle for i18n- Returns:
- a string in readable pretty duration format, using second resolution
-
getDurationPretty
-
formatDurationPretty
This is used by the Velocity templates as a bean- Parameters:
l
- a duration in seconds- Returns:
- a pretty formatted version of the duration
-