List of usage examples for org.springframework.format.datetime.joda JodaTimeFormatterRegistrar setUseIsoFormat
public void setUseIsoFormat(boolean useIsoFormat)
From source file:de.cpoepke.demos.neo4j.querydsl.config.SpringConfiguration.java
@Bean public DefaultFormattingConversionService conversionService() { // Use the DefaultFormattingConversionService but do not register defaults DefaultFormattingConversionService conversionService = new DefaultFormattingConversionService(false); // Ensure @NumberFormat is still supported conversionService.addFormatterForFieldAnnotation(new NumberFormatAnnotationFormatterFactory()); // Joda Time Converter for (Converter<?, ?> converter : JodaTimeConverters.getConvertersToRegister()) { conversionService.addConverter(converter); }//w ww .j av a 2s . c o m conversionService.addConverter(new DateMidnightToStringConverter()); conversionService.addConverter(new StringToDateMidnightConverter()); conversionService.addConverter(new DateMidnightToLongConverter()); conversionService.addConverter(new LongToDateMidnightConverter()); // Register date conversion with a specific global format JodaTimeFormatterRegistrar registrar = new JodaTimeFormatterRegistrar(); registrar.setUseIsoFormat(true); registrar.registerFormatters(conversionService); return conversionService; }