Skip to content

Commit 616c99e

Browse files
committed
Show milliseconds for times in protocol
1 parent 7859212 commit 616c99e

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

frontend/src/components/protocol/ProtocolItem.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ const props = defineProps<{
1616
const control = inject<ControlApi>('control-api')
1717
1818
const matchTime = computed(() => {
19-
return formatDurationJson(props.protocolEntry.matchTimeElapsed!)
19+
return formatDurationJson(props.protocolEntry.matchTimeElapsed!, {ms: true})
20+
})
21+
const stageTime = computed(() => {
22+
return formatDurationJson(props.protocolEntry.stageTimeElapsed!, {ms: true})
2023
})
2124
2225
const origin = computed(() => {
@@ -73,7 +76,7 @@ function revert() {
7376
<span v-if="hasGameEventOrigins">)</span>
7477
</q-item-label>
7578
<q-item-label caption lines="1">
76-
{{ matchTime }}
79+
{{ stageTime }} ({{ matchTime }})
7780
</q-item-label>
7881
</q-item-section>
7982
</template>

frontend/src/helpers/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ export const getRemainingStages = function (fromStage: Referee_StageJson): Refer
120120
return stages.slice(idx)
121121
}
122122

123-
export const formatDurationJson = function (duration: DurationJson): string {
123+
export const formatDurationJson = function (duration: DurationJson, options: { ms: boolean } = {ms: false}): string {
124124
const dur = fromJson(DurationSchema, duration)
125125
const milliseconds = Number(dur.seconds) * 1000 + dur.nanos / 1000000
126-
return formatDuration(milliseconds)
126+
return formatDuration(milliseconds, options)
127127
}
128128

129129
export const durationSeconds = function (duration: DurationJson): number {

0 commit comments

Comments
 (0)