// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.util.text;

import org.jetbrains.annotations.NotNull;

import java.text.DateFormat;
import java.util.Date;

/**
 * @author Konstantin Bulenkov
 */
public class CustomJBDateTimeFormatter extends JBDateTimeFormatter {
  @NotNull private final String myFormatterID;

  public CustomJBDateTimeFormatter(@NotNull String formatterID) {
    myFormatterID = formatterID;
  }

  protected DateFormat getFormat() {
    return DateTimeFormatManager.getInstance().getDateFormat(myFormatterID);
  }

  @Override
  protected boolean isPrettyFormattingSupported() {
    return false;
  }

  @NotNull
  @Override
  public String formatTime(long time) {
    return getFormat().format(new Date(time));
  }

  @NotNull
  @Override
  public String formatTimeWithSeconds(long time) {
    return formatTime(time);
  }

  @NotNull
  @Override
  public String formatDate(long time) {
    return formatTime(time);
  }

  @NotNull
  @Override
  public String formatPrettyDateTime(long time) {
    return formatTime(time);
  }

  @NotNull
  @Override
  public String formatPrettyDate(long time) {
    return formatTime(time);
  }
}

@@ -1257,11 +1257,441 @@
 me);%0A  %7D
+%0A%0A  @NotNull%0A  @Override%0A  public String formatDateTime(Date date) %7B%0A    return formatTime(date);%0A  %7D%0A%0A  @NotNull%0A  @Override%0A  public String formatDateTime(long time) %7B%0A    return formatTime(time);%0A  %7D%0A%0A  @NotNull%0A  @Override%0A  public String formatPrettyDateTime(@NotNull Date date) %7B%0A    return formatTime(date);%0A  %7D%0A%0A  @NotNull%0A  @Override%0A  public String formatPrettyDate(@NotNull Date date) %7B%0A    return formatTime(date);%0A  %7D
 %0A%7D%0A

add more method delegates for CustomJBDateTimeFormatter