com.atlassian.crowd.core.tiny
Class DateUtils

java.lang.Object
  extended by com.atlassian.crowd.core.tiny.DateUtils

public class DateUtils
extends Object


Constructor Summary
DateUtils(ResourceBundle resourceBundle)
           
 
Method Summary
 String formatDurationPretty(long l)
          This is used by the Velocity templates as a bean
static String getDurationPrettySecondsResolution(long numSecs, ResourceBundle resourceBundle)
          Converts a number of seconds into a pretty formatted data string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateUtils

public DateUtils(ResourceBundle resourceBundle)
Method Detail

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', while 42 becomes '42 seconds'

Parameters:
numSecs - the number of seconds in the duration
resourceBundle - a resouce bundle for i18n
Returns:
a string in readable pretty duration format, using second resolution

formatDurationPretty

public String formatDurationPretty(long l)
This is used by the Velocity templates as a bean

Parameters:
l - a duration in seconds
Returns:
a pretty formatted version of the duration


Copyright © 2016 Atlassian. All Rights Reserved.