Locale userLocale = locator.getHelper().getLocale(); final TimeFormatWithPrecision result = calculateFractionalTimeUnit(duration, hoursPerDay.multiply(BigDecimal.valueOf(DateUtils.Duration.HOUR.getSeconds())).intValueExact(), i18nBean, UNIT_DAY, scale, userLocale); if (result.remainder == 0)
Locale userLocale = locator.getHelper().getLocale(); final TimeFormatWithPrecision result = calculateFractionalTimeUnit(duration, (int) DateUtils.Duration.HOUR.getSeconds(), i18nBean, UNIT_HOUR, scale, userLocale); if (result.remainder == 0)
public String shortFormat(final Long duration, final Locale locale) { return format(duration, locator.getHelper(locale), TimeFormatWithPrecision.Scale.DEFAULT); }
public String format(Long duration, Locale locale) { return format(duration, locator.getHelper(locale).getResourceBundle()); }
public String format(Long duration) { return format(duration, locator.getHelper().getDefaultResourceBundle()); }
/** * Converts the given time duration into days and formats it based on the given user's locale. If the duration * given is a negative number, returns an empty string. * * @param duration time duration to format * @param locale user's locale * @return formatted time duration or an empty string */ public String format(Long duration, Locale locale) { return format(duration, locator.getHelper(locale), TimeFormatWithPrecision.Scale.DEFAULT); }
/** * Converts the given time duration into hours and formats it based on the given user's locale. If the duration * given is a negative number, returns an empty string. * * @param duration time duration to format * @param locale user's locale * @return formatted time duration or an empty string */ public String format(Long duration, Locale locale) { return format(duration, locator.getHelper(locale), TimeFormatWithPrecision.Scale.DEFAULT); }
/** * Converts the given time duration into hours and formats it based on the system locale. If the duration given * is a negative number, returns an empty string. * * @param duration time duration to format * @return formatted time duration or an empty string */ public String format(Long duration) { return format(duration, locator.getHelper(), TimeFormatWithPrecision.Scale.DEFAULT); }
/** * Converts the given time duration into days and formats it based on the system locale. If the duration given * is a negative number, returns an empty string. * * @param duration time duration to format * @return formatted time duration or an empty string */ public String format(Long duration) { return format(duration, locator.getHelper(), TimeFormatWithPrecision.Scale.DEFAULT); }