{#if isShowingLinkModal} { isShowingLinkModal = false; }} on:add={addAdventure} /> {/if} {#if isEditModalOpen} (isEditModalOpen = false)} on:saveEdit={saveEdit} /> {/if} {#if isShowingCreateModal} (isShowingCreateModal = false)} /> {/if} {#if notFound}
Lost

Adventure not Found

The adventure you were looking for could not be found. Please try a different adventure or check back later.

{/if} {#if !collection && !notFound}
{/if} {#if collection}
{#if collection.name}

{collection.name}

{/if} {#if adventures.length > 0}
Collection Stats
{numVisited}/{adventures.length} Visited
{#if numVisited === adventures.length}
You've completed this collection! 🎉!
{:else}
Keep exploring!
{/if}
{/if}

Linked Adventures

{#if adventures.length == 0} {/if}
{#each adventures as adventure} {/each}
{#if collection.start_date && collection.end_date}

Itinerary by Date

{#if numberOfDays}

Duration: {numberOfDays} days

{/if}

Dates: {new Date(collection.start_date).toLocaleDateString('en-US', { timeZone: 'UTC' })} - {new Date( collection.end_date ).toLocaleDateString('en-US', { timeZone: 'UTC' })}

{#each Array(numberOfDays) as _, i} {@const currentDate = new Date(collection.start_date)} {@const temp = currentDate.setDate(currentDate.getDate() + i)} {@const dateString = currentDate.toISOString().split('T')[0]} {@const dayAdventures = groupAdventuresByDate(adventures, new Date(collection.start_date))[ dateString ]}

Day {i + 1} - {currentDate.toLocaleDateString('en-US', { timeZone: 'UTC' })}

{#if dayAdventures.length > 0}
{#each dayAdventures as adventure} {/each}
{:else}

No adventures planned for this day.

{/if} {/each}
{#each adventures as adventure} {#if adventure.longitude && adventure.latitude}
{adventure.name}

{adventure.type.charAt(0).toUpperCase() + adventure.type.slice(1)}

{adventure.date ? new Date(adventure.date).toLocaleDateString('en-US', { timeZone: 'UTC' }) : ''}

{/if} {/each}
{/if} {/if}