mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-08-05 13:15:18 +02:00
Enhance visit display: Improve layout and formatting of visit dates and notes
This commit is contained in:
parent
2c50ca0b1a
commit
311e2847cb
1 changed files with 25 additions and 15 deletions
|
@ -498,22 +498,32 @@
|
||||||
{adventure.category?.display_name + ' ' + adventure.category?.icon}
|
{adventure.category?.display_name + ' ' + adventure.category?.icon}
|
||||||
</p>
|
</p>
|
||||||
{#if adventure.visits.length > 0}
|
{#if adventure.visits.length > 0}
|
||||||
<p class="text-black text-sm">
|
<p>
|
||||||
{#each adventure.visits as visit}
|
{#each adventure.visits as visit}
|
||||||
{visit.start_date
|
<div
|
||||||
? new Date(visit.start_date).toLocaleDateString(undefined, {
|
class="p-4 border border-neutral rounded-lg bg-base-100 shadow-sm flex flex-col gap-2"
|
||||||
timeZone: 'UTC'
|
>
|
||||||
})
|
<p class="text-sm text-base-content font-medium">
|
||||||
: ''}
|
{#if isAllDay(visit.start_date)}
|
||||||
{visit.end_date &&
|
<span class="badge badge-outline mr-2">All Day</span>
|
||||||
visit.end_date !== '' &&
|
{visit.start_date.split('T')[0]} – {visit.end_date.split(
|
||||||
visit.end_date !== visit.start_date
|
'T'
|
||||||
? ' - ' +
|
)[0]}
|
||||||
new Date(visit.end_date).toLocaleDateString(undefined, {
|
{:else}
|
||||||
timeZone: 'UTC'
|
{new Date(visit.start_date).toLocaleString()} – {new Date(
|
||||||
})
|
visit.end_date
|
||||||
: ''}
|
).toLocaleString()}
|
||||||
<br />
|
{/if}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<!-- If the selected timezone is not the current one show the timezone + the time converted there -->
|
||||||
|
|
||||||
|
{#if visit.notes}
|
||||||
|
<p class="text-sm text-base-content opacity-70 italic">
|
||||||
|
"{visit.notes}"
|
||||||
|
</p>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
{/each}
|
{/each}
|
||||||
</p>
|
</p>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue