Java Code Examples for org.springframework.format.datetime.standard.DateTimeFormatterRegistrar#registerFormatters()

The following examples show how to use org.springframework.format.datetime.standard.DateTimeFormatterRegistrar#registerFormatters() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestUtil.java    From cubeai with Apache License 2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 2
Source File: DateTimeFormatConfiguration.java    From spring-cloud-gray with Apache License 2.0 5 votes vote down vote up
@Override
public void addFormatters(FormatterRegistry registry) {
    DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
    registrar.setUseIsoFormat(true);
    registrar.registerFormatters(registry);
    registry.addConverter(new StringToDateConverter());
}
 
Example 3
Source File: TestUtil.java    From alchemy with Apache License 2.0 5 votes vote down vote up
/**
 * Create a {@link FormattingConversionService} which use ISO date format, instead of the localized one.
 * @return the {@link FormattingConversionService}.
 */
public static FormattingConversionService createFormattingConversionService() {
    DefaultFormattingConversionService dfcs = new DefaultFormattingConversionService ();
    DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
    registrar.setUseIsoFormat(true);
    registrar.registerFormatters(dfcs);
    return dfcs;
}
 
Example 4
Source File: TestUtil.java    From albedo with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Create a {@link FormattingConversionService} which use ISO date format, instead of the localized one.
 *
 * @return the {@link FormattingConversionService}.
 */
public static FormattingConversionService createFormattingConversionService() {
	DefaultFormattingConversionService dfcs = new DefaultFormattingConversionService();
	DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
	registrar.setUseIsoFormat(true);
	registrar.registerFormatters(dfcs);
	return dfcs;
}
 
Example 5
Source File: TestUtil.java    From java-microservices-examples with Apache License 2.0 5 votes vote down vote up
/**
 * Create a {@link FormattingConversionService} which use ISO date format, instead of the localized one.
 * @return the {@link FormattingConversionService}.
 */
public static FormattingConversionService createFormattingConversionService() {
    DefaultFormattingConversionService dfcs = new DefaultFormattingConversionService ();
    DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
    registrar.setUseIsoFormat(true);
    registrar.registerFormatters(dfcs);
    return dfcs;
}
 
Example 6
Source File: TestUtil.java    From java-microservices-examples with Apache License 2.0 5 votes vote down vote up
/**
 * Create a {@link FormattingConversionService} which use ISO date format, instead of the localized one.
 * @return the {@link FormattingConversionService}.
 */
public static FormattingConversionService createFormattingConversionService() {
    DefaultFormattingConversionService dfcs = new DefaultFormattingConversionService ();
    DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
    registrar.setUseIsoFormat(true);
    registrar.registerFormatters(dfcs);
    return dfcs;
}
 
Example 7
Source File: TestUtil.java    From TeamDojo with Apache License 2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 8
Source File: TestUtil.java    From e-commerce-microservice with Apache License 2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 9
Source File: TestUtil.java    From Full-Stack-Development-with-JHipster with MIT License 5 votes vote down vote up
/**
 * 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;
}
 
Example 10
Source File: TestUtil.java    From cubeai with Apache License 2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 11
Source File: TestUtil.java    From okta-jhipster-microservices-oauth-example with Apache License 2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 12
Source File: TestUtil.java    From cubeai with Apache License 2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 13
Source File: DateTimeFormatConfiguration.java    From cubeai with Apache License 2.0 4 votes vote down vote up
@Override
public void addFormatters(FormatterRegistry registry) {
    DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
    registrar.setUseIsoFormat(true);
    registrar.registerFormatters(registry);
}
 
Example 14
Source File: DateTimeFormatConfiguration.java    From Spring-5.0-Projects with MIT License 4 votes vote down vote up
@Override
public void addFormatters(FormatterRegistry registry) {
    DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
    registrar.setUseIsoFormat(true);
    registrar.registerFormatters(registry);
}
 
Example 15
Source File: DateTimeFormatConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Override
public void addFormatters(FormatterRegistry registry) {
    DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
    registrar.setUseIsoFormat(true);
    registrar.registerFormatters(registry);
}
 
Example 16
Source File: DateTimeFormatConfiguration.java    From 21-points with Apache License 2.0 4 votes vote down vote up
@Override
public void addFormatters(FormatterRegistry registry) {
    DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
    registrar.setUseIsoFormat(true);
    registrar.registerFormatters(registry);
}
 
Example 17
Source File: DateTimeFormatConfiguration.java    From tutorials with MIT License 4 votes vote down vote up
@Override
public void addFormatters(FormatterRegistry registry) {
    DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
    registrar.setUseIsoFormat(true);
    registrar.registerFormatters(registry);
}
 
Example 18
Source File: DateTimeFormatConfiguration.java    From java-microservices-examples with Apache License 2.0 4 votes vote down vote up
@Override
public void addFormatters(FormatterRegistry registry) {
    DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
    registrar.setUseIsoFormat(true);
    registrar.registerFormatters(registry);
}
 
Example 19
Source File: DateTimeFormatConfiguration.java    From okta-jhipster-microservices-oauth-example with Apache License 2.0 4 votes vote down vote up
@Override
public void addFormatters(FormatterRegistry registry) {
    DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
    registrar.setUseIsoFormat(true);
    registrar.registerFormatters(registry);
}
 
Example 20
Source File: DateTimeFormatConfiguration.java    From okta-jhipster-microservices-oauth-example with Apache License 2.0 4 votes vote down vote up
@Override
public void addFormatters(FormatterRegistry registry) {
    DateTimeFormatterRegistrar registrar = new DateTimeFormatterRegistrar();
    registrar.setUseIsoFormat(true);
    registrar.registerFormatters(registry);
}