Revise date label creation for optional css class
Change-Id: Ia244aedb37067c138343a9094bf489a367a4464d
| | |
| | | }
|
| | |
|
| | | public static Label createDateLabel(String wicketId, Date date, TimeZone timeZone, TimeUtils timeUtils) {
|
| | | return createDateLabel(wicketId, date, timeZone, timeUtils, true);
|
| | | }
|
| | | |
| | | public static Label createDateLabel(String wicketId, Date date, TimeZone timeZone, TimeUtils timeUtils, boolean setCss) {
|
| | | String format = GitBlit.getString(Keys.web.datestampShortFormat, "MM/dd/yy");
|
| | | DateFormat df = new SimpleDateFormat(format);
|
| | | if (timeZone == null) {
|
| | |
| | | title = tmp;
|
| | | }
|
| | | Label label = new Label(wicketId, dateString);
|
| | | if (setCss) {
|
| | | WicketUtils.setCssClass(label, timeUtils.timeAgoCss(date));
|
| | | }
|
| | | if (!StringUtils.isEmpty(title)) {
|
| | | WicketUtils.setHtmlTooltip(label, title);
|
| | | }
|