Make RelativeDateFormatter available to plugins
Change-Id: I9ab4a50c5eceec3a841c79f120ee67f428038cce Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user