Option to show relative times in changes table

Derived from the original implementation in JGit's RelativeDateFormatter
and adapted to the GWT environment. A new preference setting allows the
user to decide if he wants absolute or relative dates.

Myself as the original author and SAP agree to relicense the code
borrowed from JGit under Apache 2 license for use in Gerrit Code Review.

Change-Id: Id130f76a5937ad0d4f2e9a1b5f9f805f301b782c
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Matthias Sohn
2013-03-27 10:44:28 -04:00
parent 7044ba5f43
commit e1e95ef496
15 changed files with 308 additions and 3 deletions

View File

@@ -123,6 +123,9 @@ public final class AccountGeneralPreferences {
@Column(id = 11)
protected boolean showUsernameInReviewCategory;
@Column(id = 12)
protected boolean relativeDateInChangeTable;
public AccountGeneralPreferences() {
}
@@ -226,6 +229,14 @@ public final class AccountGeneralPreferences {
timeFormat = fmt.name();
}
public boolean isRelativeDateInChangeTable() {
return relativeDateInChangeTable;
}
public void setRelativeDateInChangeTable(final boolean relativeDateInChangeTable) {
this.relativeDateInChangeTable = relativeDateInChangeTable;
}
public void resetToDefaults() {
maximumPageSize = DEFAULT_PAGESIZE;
showSiteHeader = true;
@@ -237,5 +248,6 @@ public final class AccountGeneralPreferences {
downloadCommand = null;
dateFormat = null;
timeFormat = null;
relativeDateInChangeTable = false;
}
}