Make RelativeDateFormatter available to plugins

Change-Id: I9ab4a50c5eceec3a841c79f120ee67f428038cce
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2015-07-27 16:37:01 +02:00
parent 010d30592f
commit 76b23722f4
13 changed files with 132 additions and 77 deletions

View File

@@ -16,6 +16,7 @@ package com.google.gerrit.plugin.client;
import com.google.gerrit.client.AccountFormatter;
import com.google.gerrit.client.DateFormatter;
import com.google.gerrit.client.RelativeDateFormatter;
import com.google.gerrit.client.info.AccountInfo;
import java.util.Date;
@@ -44,6 +45,11 @@ public class FormatUtil {
return new DateFormatter(Plugin.get().getUserPreferences());
}
/** Format a date using git log's relative date format. */
public static String relativeFormat(Date dt) {
return RelativeDateFormatter.format(dt);
}
/**
* Formats an account as a name and an email address.
* <p>