mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-20 21:39:37 +02:00
collection days
This commit is contained in:
parent
055290ce3f
commit
c94a4379c7
8 changed files with 101 additions and 5 deletions
|
@ -47,6 +47,20 @@
|
|||
<div class="card-body">
|
||||
<h2 class="card-title overflow-ellipsis">{collection.name}</h2>
|
||||
<p>{collection.adventures.length} Adventures</p>
|
||||
{#if collection.start_date && collection.end_date}
|
||||
<p>
|
||||
Dates: {new Date(collection.start_date).toLocaleDateString()} - {new Date(
|
||||
collection.end_date
|
||||
).toLocaleDateString()}
|
||||
</p>
|
||||
<!-- display the duration in days -->
|
||||
<p>
|
||||
Duration: {Math.floor(
|
||||
(new Date(collection.end_date).getTime() - new Date(collection.start_date).getTime()) /
|
||||
(1000 * 60 * 60 * 24)
|
||||
)}{' '}
|
||||
days
|
||||
</p>{/if}
|
||||
<div class="card-actions justify-end">
|
||||
{#if type != 'link'}
|
||||
<button on:click={deleteCollection} class="btn btn-secondary"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue