
package de.ivu.elect.jee.presentation.dynamicform;

import java.text.DateFormat;
import java.util.Locale;

public abstract class AbstractTimestampProperty extends AbstractTemporalProperty {

  protected AbstractTimestampProperty() {
    super();
  }

  @Override
  public PropertyType getDefaultType() {
    return PropertyType.INPUT_CALENDAR_TIME;
  }

  @Override
  public boolean isShowTime() {
    return true;
  }

  @Override
  protected DateFormat createDateFormat(Locale locale) {
    // E.g. dd.MM.yyyy HH:mm (German) ELECT-3052 Sekunden entfernt
    int dateStyle = DateFormat.MEDIUM;
    int timeStyle = DateFormat.SHORT;

    return DateFormat.getDateTimeInstance(dateStyle, timeStyle, locale);
  }
}
