本文整理汇总了Java中org.springframework.format.datetime.standard.DateTimeFormatterRegistrar.setUseIsoFormat方法的典型用法代码示例。如果您正苦于以下问题:Java DateTimeFormatterRegistrar.setUseIsoFormat方法的具体用法?Java DateTimeFormatterRegistrar.setUseIsoFormat怎么用?Java DateTimeFormatterRegistrar.setUseIsoFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.format.datetime.standard.DateTimeFormatterRegistrar
的用法示例。
在下文中一共展示了DateTimeFormatterRegistrar.setUseIsoFormat方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFormattingConversionService
import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; //导入方法依赖的package包/类
/**
* Create a FormattingConversionService which use ISO date format, instead of the localized one.
* @return the FormattingConversionService
*/
public static FormattingConversionService createFormattingConversionService() {
DefaultFormattingConversionService dfcs = new DefaultFormattingConversionService ();
DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
registrar.setUseIsoFormat(true);
registrar.registerFormatters(dfcs);
return dfcs;
}
示例2: localDateFeignFormatterRegistrar
import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; //导入方法依赖的package包/类
/**
* Bugfix for Feign not knowing how to handle @DateTimeFormat in query parameters
*
* see https://github.com/spring-cloud/spring-cloud-netflix/issues/1178
*/
@Bean
public FeignFormatterRegistrar localDateFeignFormatterRegistrar() {
return formatterRegistry -> {
DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
registrar.setUseIsoFormat(true);
registrar.registerFormatters(formatterRegistry);
};
}
示例3: addFormatters
import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; //导入方法依赖的package包/类
@Override
public void addFormatters(FormatterRegistry registry) {
DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
registrar.setUseIsoFormat(true);
registrar.registerFormatters(registry);
}
开发者ID:mraible,项目名称:devoxxus-jhipster-microservices-demo,代码行数:7,代码来源:DateTimeFormatConfiguration.java
示例4: addFormatters
import org.springframework.format.datetime.standard.DateTimeFormatterRegistrar; //导入方法依赖的package包/类
@Override
public void addFormatters(FormatterRegistry registry) {
DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
registrar.setUseIsoFormat(true);
registrar.registerFormatters(registry);
}