Merge remote-tracking branch 'server/master'

This commit is contained in:
Axel Uhl committed 2017-07-12 17:54:43 +02:00
commit 59e0e31dad
3 files changed
+11 -1

No files matched your search

@@ -60,6 +60,7 @@ public class LiveRacesList extends Composite {
this.fleetCornerColumn.setShowDetails(hasFleets);
this.fleetNameColumn.setShowDetails(hasFleets);
this.startTimeColumn.setShowTimeOnly(!RaceListDataUtil.hasDifferentStartDates(data));
this.startTimeColumn.setShowSeconds(true);
this.courseAreaColumn.setShowDetails(RaceListDataUtil.hasCourseAreas(data));
this.courseColumn.setShowDetails(RaceListDataUtil.hasCourses(data));
boolean hasWind = RaceListDataUtil.hasWind(data);
@@ -1,5 +1,6 @@
package com.sap.sailing.gwt.home.desktop.partials.racelist;
import static com.sap.sailing.gwt.ui.common.client.DateAndTimeFormatterUtil.mediumTimeFormatter;
import static com.sap.sailing.gwt.ui.common.client.DateAndTimeFormatterUtil.shortTimeFormatter;
import java.util.Date;
@@ -518,6 +519,10 @@ public class RaceListColumnFactory {
((StartTimeCell) getCell()).showTimeOnly = showTimeOnly;
}
public void setShowSeconds(boolean showSeconds) {
((StartTimeCell) getCell()).showSeconds = showSeconds;
}
@Override
public String getHeaderStyle() {
return CSS.raceslist_head_item();
@@ -536,10 +541,12 @@ public class RaceListColumnFactory {
private static class StartTimeCell extends AbstractCell<Date> {
private static final DateTimeFormat DATE_FORMAT = DateTimeFormat.getFormat(PredefinedFormat.MONTH_NUM_DAY);
private boolean showTimeOnly = true;
private boolean showSeconds = false;
@Override
public void render(Context context, Date value, SafeHtmlBuilder sb) {
if (value != null) {
sb.appendEscaped((showTimeOnly ? "" : DATE_FORMAT.format(value) + " ") + shortTimeFormatter.render(value));
sb.appendEscaped((showTimeOnly ? "" : DATE_FORMAT.format(value) + " "));
sb.appendEscaped(showSeconds ? mediumTimeFormatter.render(value) : shortTimeFormatter.render(value));
}
}
}
@@ -17,6 +17,8 @@ public class DateAndTimeFormatterUtil {
DateTimeFormat.getFormat(PredefinedFormat.TIME_LONG));
public static DateTimeFormatRenderer shortTimeFormatter = new DateTimeFormatRenderer(
DateTimeFormat.getFormat(PredefinedFormat.TIME_SHORT));
public static DateTimeFormatRenderer mediumTimeFormatter = new DateTimeFormatRenderer(
DateTimeFormat.getFormat(PredefinedFormat.TIME_MEDIUM));
public static DateTimeFormatRenderer weekdayMonthAbbrDayDateFormatter = new DateTimeFormatRenderer(
DateTimeFormat.getFormat("EEE, " + LocaleInfo.getCurrentLocale().getDateTimeFormatInfo().formatMonthAbbrevDay()));