コード例 #1
0
  private void setUp(DateTimeFormatterRegistrar registrar) {
    conversionService = new FormattingConversionService();
    DefaultConversionService.addDefaultConverters(conversionService);
    registrar.registerFormatters(conversionService);

    DateTimeBean bean = new DateTimeBean();
    bean.getChildren().add(new DateTimeBean());
    binder = new DataBinder(bean);
    binder.setConversionService(conversionService);

    LocaleContextHolder.setLocale(Locale.US);
    DateTimeContext context = new DateTimeContext();
    context.setTimeZone(ZoneId.of("-05:00"));
    DateTimeContextHolder.setDateTimeContext(context);
  }
コード例 #2
0
 @After
 public void tearDown() {
   LocaleContextHolder.setLocale(null);
   DateTimeContextHolder.setDateTimeContext(null);
 }