@Test public void testConvertToPresentation_locale_de() { LocalDateTime dateTime = new LocalDateTime(2016, 12, 29, 15, 30, 0, 555); String presentation = new JodaLocalDateTimeToStringConverter().convertToPresentation(dateTime, null, Locale.GERMANY); assertNotNull(presentation); assertThat(presentation, is("29.12.2016\t15:30")); }
@CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDateTime value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws ConversionException { if (value == null) { return ""; } String dateString = localDateConverter.convertToPresentation(value.toLocalDate(), targetType, locale); String timeString = DateTimeFormat.shortTime() .withLocale(JodaLocalDateToStringConverter.getNullsafeLocale(locale)) .print(value); return dateString + '\t' + timeString; }
JodaLocalDateTimeToStringConverter implements Converter<String, LocalDateTime> { @CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDateTime value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws ConversionException { if (value == null) { return ""; } String dateString = localDateConverter.convertToPresentation(value.toLocalDate(), targetType, locale); String timeString = DateTimeFormat.shortTime() .withLocale(JodaLocalDateToStringConverter.getNullsafeLocale(locale)) .print(value); return dateString + '\t' + timeString; } }
JodaLocalDateTimeToStringConverter implements Converter<String, LocalDateTime> { @CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDateTime value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws ConversionException { if (value == null) { return ""; } String dateString = localDateConverter.convertToPresentation(value.toLocalDate(), targetType, locale); String timeString = DateTimeFormat.shortTime() .withLocale(JodaLocalDateToStringConverter.getNullsafeLocale(locale)) .print(value); return dateString + '\t' + timeString; }  }
JodaLocalDateTimeToStringConverter implements Converter<String, LocalDateTime> { @CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDateTime value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws ConversionException { if (value == null) { return ""; } String dateString = localDateConverter.convertToPresentation(value.toLocalDate(), targetType, locale); String timeString = DateTimeFormat.shortTime() .withLocale(JodaLocalDateToStringConverter.getNullsafeLocale(locale)) .print(value); return dateString + '\t' + timeString; }  @CheckForNull @Override LocalDateTime convertToModel(@CheckForNull String value,
            @CheckForNull Class<? extends LocalDateTime> targetType,
            @CheckForNull Locale locale); @CheckForNull @Override String convertToPresentation(@CheckForNull LocalDateTime value,
            @CheckForNull Class<? extends String> targetType,
            @CheckForNull Locale locale); @Override Class<LocalDateTime> getModelType(); @Override Class<String> getPresentationType(); }
JodaLocalDateTimeToStringConverter implements Converter<String, LocalDateTime> { @CheckForNull @Override public String convertToPresentation(@CheckForNull LocalDateTime value, @CheckForNull Class<? extends String> targetType, @CheckForNull Locale locale) throws ConversionException { if (value == null) { return ""; } String dateString = localDateConverter.convertToPresentation(value.toLocalDate(), targetType, locale); String timeString = DateTimeFormat.shortTime() .withLocale(JodaLocalDateToStringConverter.getNullsafeLocale(locale)) .print(value); return dateString + '\t' + timeString; }  @CheckForNull @Override LocalDateTime convertToModel(@CheckForNull String value,
            @CheckForNull Class<? extends LocalDateTime> targetType,
            @CheckForNull Locale locale); @CheckForNull @Override String convertToPresentation(@CheckForNull LocalDateTime value,
            @CheckForNull Class<? extends String> targetType,
            @CheckForNull Locale locale); @Override Class<LocalDateTime> getModelType(); @Override Class<String> getPresentationType();  }