Example usage for org.eclipse.jgit.util RelativeDateFormatter format

List of usage examples for org.eclipse.jgit.util RelativeDateFormatter format

Introduction

In this page you can find the example usage for org.eclipse.jgit.util RelativeDateFormatter format.

Prototype

@SuppressWarnings("boxing")
public static String format(Date when) 

Source Link

Document

Get age of given java.util.Date compared to now formatted in the same relative format as returned by git log --relative-date

Usage

From source file:com.google.gitiles.CommitSoyData.java

License:Open Source License

static Map<String, String> toSoyData(PersonIdent ident, GitDateFormatter dateFormatter) {
    return ImmutableMap.of("name", ident.getName(), "email", ident.getEmailAddress(), "time",
            dateFormatter.formatDate(ident),
            // TODO(dborowitz): Switch from relative to absolute at some threshold.
            "relativeTime", RelativeDateFormatter.format(ident.getWhen()));
}