List of usage examples for org.eclipse.jgit.util GitDateFormatter formatDate
@SuppressWarnings("boxing") public String formatDate(PersonIdent ident)
From source file:com.google.gerrit.server.notedb.CommentsInNotesUtil.java
License:Apache License
public static String formatTime(PersonIdent ident, Timestamp t) { GitDateFormatter dateFormatter = new GitDateFormatter(Format.DEFAULT); // TODO(dborowitz): Use a ThreadLocal or use Joda. PersonIdent newIdent = new PersonIdent(ident, t); return dateFormatter.formatDate(newIdent); }
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())); }