Skip to content

Commit e2df1a7

Browse files
committed
Add chapter duration next to start time.
This adds the duration to the chapter table on the book page.
1 parent 2c4b9f5 commit e2df1a7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

components/tables/ChaptersTable.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<tr>
1616
<th class="text-left">{{ $strings.LabelTitle }}</th>
1717
<th class="text-center w-16">{{ $strings.LabelStart }}</th>
18+
<th class="text-center w-16">{{ $strings.LabelDuration }}</th>
1819
</tr>
1920
<tr v-for="chapter in chapters" :key="chapter.id">
2021
<td>
@@ -23,6 +24,9 @@
2324
<td class="font-mono text-center underline w-16" @click.stop="goToTimestamp(chapter.start)">
2425
{{ $secondsToTimestamp(chapter.start) }}
2526
</td>
27+
<td class="font-mono text-center">
28+
{{ $secondsToTimestamp(Math.max(0, chapter.end - chapter.start)) }}
29+
</td>
2630
</tr>
2731
</table>
2832
</transition>

0 commit comments

Comments
 (0)