]> source.dussan.org Git - gitblit.git/commitdiff
Revise date label creation for optional css class
authorJames Moger <james.moger@gitblit.com>
Mon, 30 Sep 2013 13:04:23 +0000 (09:04 -0400)
committerJames Moger <james.moger@gitblit.com>
Mon, 30 Sep 2013 14:10:48 +0000 (10:10 -0400)
Change-Id: Ia244aedb37067c138343a9094bf489a367a4464d

src/main/java/com/gitblit/wicket/WicketUtils.java

index 1cf465e16f33153a81cbf00fcf4e321ad8c1d001..48bcbcc986a4522f5e42864346e07428e5892eb5 100644 (file)
@@ -507,6 +507,10 @@ public class WicketUtils {
        }\r
 \r
        public static Label createDateLabel(String wicketId, Date date, TimeZone timeZone, TimeUtils timeUtils) {\r
+               return createDateLabel(wicketId, date, timeZone, timeUtils, true);\r
+       }\r
+       \r
+       public static Label createDateLabel(String wicketId, Date date, TimeZone timeZone, TimeUtils timeUtils, boolean setCss) {\r
                String format = GitBlit.getString(Keys.web.datestampShortFormat, "MM/dd/yy");\r
                DateFormat df = new SimpleDateFormat(format);\r
                if (timeZone == null) {\r
@@ -530,7 +534,9 @@ public class WicketUtils {
                        title = tmp;\r
                }\r
                Label label = new Label(wicketId, dateString);\r
-               WicketUtils.setCssClass(label, timeUtils.timeAgoCss(date));\r
+               if (setCss) {\r
+                       WicketUtils.setCssClass(label, timeUtils.timeAgoCss(date));\r
+               }\r
                if (!StringUtils.isEmpty(title)) {\r
                        WicketUtils.setHtmlTooltip(label, title);\r
                }\r