com.aelitis.azureus.core.metasearch.utils
Class MomentsAgoDateFormatter

java.lang.Object
  extended by com.aelitis.azureus.core.metasearch.utils.MomentsAgoDateFormatter

public class MomentsAgoDateFormatter
extends Object

Improvement based on AZWEB-318.

Since:
3.2.1.0 6/19/2007
Version:
3.2.1.0 6/19/2007

Constructor Summary
MomentsAgoDateFormatter()
           
 
Method Summary
static String getMomentsAgoString(Date pastDate)
          Returns "x ago on " by comparing the given pastDate with the current time.
static String getMomentsAgoString(Date pastDate, DateFormat format)
          Returns "x ago on " by comparing the given pastDate with the current time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MomentsAgoDateFormatter

public MomentsAgoDateFormatter()
Method Detail

getMomentsAgoString

public static String getMomentsAgoString(Date pastDate,
                                         DateFormat format)
Returns "x ago on " by comparing the given pastDate with the current time. All formats are converted to GMT time. In the future the user might have their own locale, in which case we will display the time in their own locale (neat!)

Parameters:
pastDate - A date in the past
format - The format for the pastDate
Returns:
"x ago on "

getMomentsAgoString

public static String getMomentsAgoString(Date pastDate)
Returns "x ago on " by comparing the given pastDate with the current time.

Parameters:
pastDate - A default locale date in the past
Returns:
"x ago"