diff options
author | Godin <mandrikov@gmail.com> | 2010-12-01 13:38:41 +0000 |
---|---|---|
committer | Godin <mandrikov@gmail.com> | 2010-12-01 13:38:41 +0000 |
commit | 612acd33d50be6e3e4d6084ae2f6dce7edd7b4c8 (patch) | |
tree | 21cac37fd050ec004f49473e586fe8444c393b30 /sonar-gwt-api | |
parent | 0ec9be1302badbb39c4d9e6d9166584aabab914d (diff) | |
download | sonarqube-612acd33d50be6e3e4d6084ae2f6dce7edd7b4c8.tar.gz sonarqube-612acd33d50be6e3e4d6084ae2f6dce7edd7b4c8.zip |
SONAR-1450: Add creation date of violation to violations tab
Diffstat (limited to 'sonar-gwt-api')
-rw-r--r-- | sonar-gwt-api/src/main/java/org/sonar/gwt/Utils.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sonar-gwt-api/src/main/java/org/sonar/gwt/Utils.java b/sonar-gwt-api/src/main/java/org/sonar/gwt/Utils.java index 65abbadb5a1..4b6205071fc 100644 --- a/sonar-gwt-api/src/main/java/org/sonar/gwt/Utils.java +++ b/sonar-gwt-api/src/main/java/org/sonar/gwt/Utils.java @@ -19,6 +19,10 @@ */ package org.sonar.gwt; +import java.util.Date; + +import com.google.gwt.i18n.client.DateTimeFormat; + import com.google.gwt.i18n.client.NumberFormat; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; @@ -57,6 +61,20 @@ public final class Utils { public static String formatNumber(double number) { return NumberFormat.getDecimalFormat().format(number); } + + /** + * @since 2.5 + */ + public static String formatDate(Date date) { + return date == null ? "" : DateTimeFormat.getFormat("dd/MM/yy").format(date); + } + + /** + * @since 2.5 + */ + public static String formatDateTime(Date date) { + return date == null ? "" : DateTimeFormat.getFormat("dd/MM/yy HH:mm").format(date); + } public static native void showError(String message) /*-{ $wnd.error(message); |