org.loom.util
Class DateUtils

java.lang.Object
  extended by org.loom.util.DateUtils

public class DateUtils
extends java.lang.Object


Constructor Summary
DateUtils()
           
 
Method Summary
static java.lang.String humanized(MessagesRepository repository, java.util.Date value)
          Format a Date in minutes/hours/days etc, relative to today.
static java.lang.String humanizedDuration(MessagesRepository repository, long value, int maxUnits)
          Format a lapse of time in seconds/minutes/hours/days.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateUtils

public DateUtils()
Method Detail

humanized

public static java.lang.String humanized(MessagesRepository repository,
                                         java.util.Date value)
Format a Date in minutes/hours/days etc, relative to today. Equivalent to DateHelper.time_ago_in_words in Ruby and Date.humanized in format.js


humanizedDuration

public static java.lang.String humanizedDuration(MessagesRepository repository,
                                                 long value,
                                                 int maxUnits)
Format a lapse of time in seconds/minutes/hours/days. Equivalent to DateHelper.distance_of_time_in_words in Ruby and Date.toDuration().humanized() in format.js

Parameters:
value - interval to format, in milliseconds
maxUnits - the maximum number of units to use (years, months, days, etc).