@Test public void testFormatTime() { assertEquals("minutes converted to hours and minutes", "1:30", UNDER_TEST.formatDuration("90")); }
@Override public String formatTime(String dateString) { if (dateString == null || dateString.isEmpty()) { return ""; } Date date = parseDate(dateString); DateFormat dateTimeFormatter = DateFormat.getTimeInstance(DateFormat.SHORT, bundle.getLocal()); dateTimeFormatter.setTimeZone(bundle.getTimeZone()); return dateTimeFormatter.format(date); }
ResourceLocalizer implements Localizer { @Override public String formatTime(String dateString) { if (dateString == null || dateString.isEmpty()) { return ""; } Date date = parseDate(dateString); DateFormat dateTimeFormatter = DateFormat.getTimeInstance(DateFormat.SHORT, bundle.getLocal()); dateTimeFormatter.setTimeZone(bundle.getTimeZone()); return dateTimeFormatter.format(date); } }
ResourceLocalizer implements Localizer { @Override public String formatTime(String dateString) { if (dateString == null || dateString.isEmpty()) { return ""; } Date date = parseDate(dateString); DateFormat dateTimeFormatter = DateFormat.getTimeInstance(DateFormat.SHORT, bundle.getLocal()); dateTimeFormatter.setTimeZone(bundle.getTimeZone()); return dateTimeFormatter.format(date); } ResourceLocalizer(LocalizationBundle bundle); }
ResourceLocalizer implements Localizer { @Override public String formatTime(String dateString) { if (dateString == null || dateString.isEmpty()) { return ""; } Date date = parseDate(dateString); DateFormat dateTimeFormatter = DateFormat.getTimeInstance(DateFormat.SHORT, bundle.getLocal()); dateTimeFormatter.setTimeZone(bundle.getTimeZone()); return dateTimeFormatter.format(date); } ResourceLocalizer(LocalizationBundle bundle); @Override String formatDate(String dateString); @Override String formatDateTime(String dateString); @Override String formatTime(String dateString); @Override String getText(String key, String defaultText, Object... arguments); @Override String formatDuration(String duration); @Override String formatMoney(String amount, String currencyCode); @Override String formatInteger(String integerString); @Override String formatFloat(String numberString, String numberOfDigits); @Override String formatPercentage(String numberString, String numberOfDigits); @Override String formatMinutes(String durationString); }
ResourceLocalizer implements Localizer { @Override public String formatTime(String dateString) { if (dateString == null || dateString.isEmpty()) { return ""; } Date date = parseDate(dateString); DateFormat dateTimeFormatter = DateFormat.getTimeInstance(DateFormat.SHORT, bundle.getLocal()); dateTimeFormatter.setTimeZone(bundle.getTimeZone()); return dateTimeFormatter.format(date); } ResourceLocalizer(LocalizationBundle bundle); @Override String formatDate(String dateString); @Override String formatDateTime(String dateString); @Override String formatTime(String dateString); @Override String getText(String key, String defaultText, Object... arguments); @Override String formatDuration(String duration); @Override String formatMoney(String amount, String currencyCode); @Override String formatInteger(String integerString); @Override String formatFloat(String numberString, String numberOfDigits); @Override String formatPercentage(String numberString, String numberOfDigits); @Override String formatMinutes(String durationString);  }