@Test public void formatWithDefault() throws Exception { assertEquals(DateTimeUtils.formatWithDefault("en", "us").getLocale(), Locale.US); }
public static DateTimeFormatter formatWithDefault(String lang, String country) { return (StringUtils.isNotBlank(lang)) ? DateTimeFormat.longDateTime().withLocale(DateTimeUtils.getLocaleByCountry(lang, country)) : DateTimeFormat.longDateTime().withLocale(Locale.getDefault()); }
DateTimeUtils { public static DateTimeFormatter formatWithDefault(String lang, String country) { return (StringUtils.isNotBlank(lang)) ? DateTimeFormat.longDateTime().withLocale(DateTimeUtils.getLocaleByCountry(lang, country)) : DateTimeFormat.longDateTime().withLocale(Locale.getDefault()); } }
DateTimeUtils { public static DateTimeFormatter formatWithDefault(String lang, String country) { return (StringUtils.isNotBlank(lang)) ? DateTimeFormat.longDateTime().withLocale(DateTimeUtils.getLocaleByCountry(lang, country)) : DateTimeFormat.longDateTime().withLocale(Locale.getDefault()); }  }
DateTimeUtils { public static DateTimeFormatter formatWithDefault(String lang, String country) { return (StringUtils.isNotBlank(lang)) ? DateTimeFormat.longDateTime().withLocale(DateTimeUtils.getLocaleByCountry(lang, country)) : DateTimeFormat.longDateTime().withLocale(Locale.getDefault()); }  static boolean isUnix(String locale); static boolean isMilliseconds(String locale); static boolean isDateValid(String date, Locale locale); static Locale getLocaleByCountry(String lang, String country); static DateTime getJodaOrJavaDate(final DateTimeFormatter dateFormatter, final String date); static DateTimeFormatter getDateFormatter(String format, String lang, String country); static DateTimeFormatter formatWithDefault(String lang, String country); }
DateTimeUtils { public static DateTimeFormatter formatWithDefault(String lang, String country) { return (StringUtils.isNotBlank(lang)) ? DateTimeFormat.longDateTime().withLocale(DateTimeUtils.getLocaleByCountry(lang, country)) : DateTimeFormat.longDateTime().withLocale(Locale.getDefault()); }  static boolean isUnix(String locale); static boolean isMilliseconds(String locale); static boolean isDateValid(String date, Locale locale); static Locale getLocaleByCountry(String lang, String country); static DateTime getJodaOrJavaDate(final DateTimeFormatter dateFormatter, final String date); static DateTimeFormatter getDateFormatter(String format, String lang, String country); static DateTimeFormatter formatWithDefault(String lang, String country);  }