@rasifix/orienteering-utils 2.0.13 → 2.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/time.js +3 -3
- package/lib/utils/ranking.js +1 -1
- package/package.json +1 -1
package/lib/time.js
CHANGED
|
@@ -42,11 +42,11 @@ function formatTime(seconds) {
|
|
|
42
42
|
return undefined;
|
|
43
43
|
}
|
|
44
44
|
var sign = seconds < 0 ? '-' : '';
|
|
45
|
-
var value = Math.abs(seconds);
|
|
45
|
+
var value = Math.abs(Math.round(seconds));
|
|
46
46
|
if (value >= 3600) {
|
|
47
|
-
return sign + Math.floor(value / 3600) + ":" + pad(Math.floor(value / 60) % 60) + ":" + pad(
|
|
47
|
+
return sign + Math.floor(value / 3600) + ":" + pad(Math.floor(value / 60) % 60) + ":" + pad(value % 60);
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
|
-
return Math.floor(value / 60) + ":" + pad(
|
|
50
|
+
return sign + Math.floor(value / 60) + ":" + pad(value % 60);
|
|
51
51
|
}
|
|
52
52
|
}
|
package/lib/utils/ranking.js
CHANGED
|
@@ -221,7 +221,7 @@ function defineCourses(runners) {
|
|
|
221
221
|
function defineRunners(runners) {
|
|
222
222
|
return runners.filter(function (runner) { return runner.splits.length > 0 && runner.splits.every(function (split) { return split.code; }); }).map(function (runner) {
|
|
223
223
|
var splits = runner.splits.map(function (split, idx) { return defineRunnerLegSplit(split, idx, runner); });
|
|
224
|
-
if (!runner.splits.some(function (s) { return s.code
|
|
224
|
+
if (!runner.splits.some(function (s) { return s.code === "Zi"; })) {
|
|
225
225
|
var lastSplit = defineRunnerLegSplit({ code: "Zi", time: runner.time }, runner.splits.length, runner);
|
|
226
226
|
splits = splits.concat([lastSplit]);
|
|
227
227
|
}
|