/** * This is used by the Velocity templates as a bean * * @param l a duration in seconds * @return a pretty formatted version of the duration */ public String formatDurationPretty(long l) { return DateUtils.getDurationPretty(l, resourceBundle); }
/** * This is used by the WebWork tags as a bean * Despite the name it doesn't actually format a duration string. It takes a long. * * @param l a duration in seconds * @return a pretty formatted version of the duration * @see #formatDurationPretty * @deprecated You should be calling formatDurationPretty */ public String formatDurationString(long l) { return DateUtils.getDurationPretty(l, resourceBundle); }
/** This is used by the Velocity templates as a bean */ public String formatDurationPretty(long l) { return DateUtils.getDurationPretty(l, resourceBundle); }
/** This is used by the WebWork tags as a bean */ public String formatDurationString(long l) { return DateUtils.getDurationPretty(l, resourceBundle); }
/** This is used by the Velocity templates as a bean */ public String formatDurationPretty(String seconds) { return DateUtils.getDurationPretty(Long.parseLong(seconds), resourceBundle); }
/** * This is used by the Velocity templates as a bean * * @param seconds duration as a string * @return a pretty formatted version of the duration */ public String formatDurationPretty(String seconds) { return DateUtils.getDurationPretty(Long.parseLong(seconds), resourceBundle); }
@Override public String prettyPrint(long periodOffSet) { return DateUtils.getDurationPretty(periodOffSet, i18n.getResourceBundle()); } }
private String prettyTime(long time) { if (time < 1000) { return "Less than a second"; } else if (time / DateUtils.SECOND_MILLIS < 60) { return time / DateUtils.SECOND_MILLIS + " seconds"; } String minutesAndAbove = null; try { minutesAndAbove = DateUtils.getDurationPretty(time / DateUtils.SECOND_MILLIS, getResourceBundle()); } catch (MissingResourceException e) { log.error("Could not load resourcebundle for 'minute'!'", e); } long secondsRemainder = (time / DateUtils.SECOND_MILLIS) % 60; if (secondsRemainder > 0) { minutesAndAbove += ", " + secondsRemainder + " second" + (secondsRemainder == 1 ? "" : "s"); } return minutesAndAbove; }
public String getPrettyImportDuration() { // Convert from milliseconds to seconds final long durationInSeconds = getProjectImportResults().getImportDuration() / 1000; return DateUtils.getDurationPretty(durationInSeconds, getJiraServiceContext().getI18nBean().getDefaultResourceBundle()); }