Class TimeRemainingFormatter

java.lang.Object
com.atlassian.greenhopper.util.TimeRemainingFormatter

public class TimeRemainingFormatter extends Object
Formats a date as a string representing how much time is remaining (or how overdue the time is).
  • Constructor Details

    • TimeRemainingFormatter

      public TimeRemainingFormatter()
  • Method Details

    • format

      public TimeRemainingFormatter.TimeRemaining format(org.joda.time.DateTime dateTime, I18n2 i18n)
      Formats the given date to an approximate amount of time remaining. The result depends on the amount of time between the date and now:
      • Two weeks or more - x weeks left/overdue
      • 1 day to 13 days - x days left/overdue
      • 1 hour to 23 hours - x hours left/overdue
      • 0 minutes to 59 minutes - x minutes left/overdue
      Parameters:
      dateTime - the DateTime to format. The formatted date will be in the time zone specified by the value of this parameter's AbstractInstant.getZone() method.
      i18n - i18n
      Returns:
      a formatted DateTime