Closed
Description
As indicated in this ticket, it's a bit cumbersome (though doable) to make Spring MVC properly bind the ISO dates and times created through HTML input elements of type date
or time
. A custom WebMvcConfigurer
can be used to enable this by default:
@Bean
WebMvcConfigurer isoDatesByDefault() {
return new WebMvcConfigurer() {
public void addFormatters(FormatterRegistry registry) {
DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
registrar.setUseIsoFormat(true);
registrar.registerFormatters(registry);
}
}
}
As it's very likely to be what users expect to work by default, it would be cool if this could be enabled via a property. I guess for backwards compatibility reasons it should stay deactivated by default.