package ru.micord.ervu.component.formatter;

import java.time.format.DateTimeFormatter;

import ru.cg.webbpm.modules.standard_annotations.validation.NotNull;

import static ru.micord.ervu.util.DateUtil.convertToLocalDate;
import static ru.micord.ervu.util.DateUtil.convertToString;

/**
 * @author gulnaz
 */
public class LocalDateFormatter implements FieldFormatter<String, String> {

  @NotNull
  public String format;

  @Override
  public String format(String value) {
    return convertToString(convertToLocalDate(value), DateTimeFormatter.ofPattern(format));
  }
}
