mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-06 04:13:51 +00:00
Changed format of 'time traveled' for a race to 'hh:mm:ss' format instead of 's'
This commit is contained in:
1 parent
ad6eccf40c
commit
a8546f3ee9
2 files changed
+9
-3
No files matched your search
+1
-1
@@ -213,7 +213,6 @@ public class DetailTypeFormatter {
|
||||
case TIME_TRAVELED:
|
||||
case CORRECTED_TIME_TRAVELED:
|
||||
case RACE_CALCULATED_TIME_TRAVELED:
|
||||
case RACE_TIME_TRAVELED:
|
||||
case RACE_TIME_TRAVELED_DOWNWIND:
|
||||
case RACE_TIME_TRAVELED_REACHING:
|
||||
case RACE_TIME_TRAVELED_UPWIND:
|
||||
@@ -231,6 +230,7 @@ public class DetailTypeFormatter {
|
||||
case TOTAL_TIME_SAILED_DOWNWIND_IN_SECONDS:
|
||||
case TOTAL_TIME_SAILED_UPWIND_IN_SECONDS:
|
||||
case TOTAL_TIME_SAILED_REACHING_IN_SECONDS:
|
||||
case RACE_TIME_TRAVELED:
|
||||
return stringMessages.hhmmssUnit();
|
||||
|
||||
// Cases for detail types without unit, so that an empty string is returned.
|
||||
|
||||
+8
-2
@@ -5,6 +5,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gwt.cell.client.Cell.Context;
|
||||
import com.google.gwt.i18n.client.NumberFormat;
|
||||
import com.google.gwt.cell.client.TextCell;
|
||||
import com.google.gwt.safehtml.shared.SafeHtml;
|
||||
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
|
||||
@@ -17,6 +18,7 @@ import com.sap.sailing.domain.common.dto.LeaderboardRowDTO;
|
||||
import com.sap.sailing.domain.common.dto.LegEntryDTO;
|
||||
import com.sap.sailing.domain.common.impl.InvertibleComparatorAdapter;
|
||||
import com.sap.sailing.gwt.ui.client.DetailTypeFormatter;
|
||||
import com.sap.sailing.gwt.ui.client.NumberFormatterFactory;
|
||||
import com.sap.sailing.gwt.ui.client.StringMessages;
|
||||
import com.sap.sailing.gwt.ui.client.shared.controls.AbstractSortableColumnWithMinMax;
|
||||
import com.sap.sailing.gwt.ui.leaderboard.DetailTypeColumn.LegDetailField;
|
||||
@@ -130,8 +132,12 @@ public class TimeTraveledRaceColumn extends ExpandableSortableColumn<String> imp
|
||||
if (result == null) {
|
||||
return "";
|
||||
} else {
|
||||
Integer intResult = ((int) (double) result);
|
||||
return intResult.toString();
|
||||
Integer timeInSeconds = ((int) (double) result);
|
||||
int hh = (int) (timeInSeconds / 3600);
|
||||
int mm = (int) ((timeInSeconds - 3600 * hh) / 60);
|
||||
int ss = (int) (timeInSeconds - 3600 * hh - 60 * mm);
|
||||
NumberFormat numberFormat = NumberFormatterFactory.getDecimalFormat(2, 0);
|
||||
return "" + numberFormat.format(hh) + ":" + numberFormat.format(mm) + ":" + numberFormat.format(ss);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user