1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-23 14:59:36 +02:00

refactor: Update date formatting in CollectionCard and CollectionPage components

This commit is contained in:
Sean Morley 2024-07-27 14:44:15 -04:00
parent dbe2f01b8d
commit 0ea9f1d73e
2 changed files with 6 additions and 6 deletions

View file

@ -49,9 +49,9 @@
<p>{collection.adventures.length} Adventures</p> <p>{collection.adventures.length} Adventures</p>
{#if collection.start_date && collection.end_date} {#if collection.start_date && collection.end_date}
<p> <p>
Dates: {new Date(collection.start_date).toLocaleDateString()} - {new Date( Dates: {new Date(collection.start_date).toLocaleDateString('en-US', { timeZone: 'UTC' })} - {new Date(
collection.end_date collection.end_date
).toLocaleDateString()} ).toLocaleDateString('en-US', { timeZone: 'UTC' })}
</p> </p>
<!-- display the duration in days --> <!-- display the duration in days -->
<p> <p>

View file

@ -238,11 +238,11 @@
</div> </div>
{#if collection.start_date && collection.end_date} {#if collection.start_date && collection.end_date}
<h1 class="text-center font-bold text-4xl mt-4 mb-2">Itinerary</h1> <h1 class="text-center font-bold text-4xl mt-4">Itinerary</h1>
{#if numberOfDays} {#if numberOfDays}
<p class="text-center text-lg mt-4 pl-16 pr-16">Duration: {numberOfDays} days</p> <p class="text-center text-lg pl-16 pr-16">Duration: {numberOfDays} days</p>
{/if} {/if}
<p class="text-center text-lg mt-4 pl-16 pr-16"> <p class="text-center text-lg pl-16 pr-16">
Dates: {new Date(collection.start_date).toLocaleDateString('en-US', { timeZone: 'UTC' })} - {new Date( Dates: {new Date(collection.start_date).toLocaleDateString('en-US', { timeZone: 'UTC' })} - {new Date(
collection.end_date collection.end_date
).toLocaleDateString('en-US', { timeZone: 'UTC' })} ).toLocaleDateString('en-US', { timeZone: 'UTC' })}
@ -257,7 +257,7 @@
dateString dateString
]} ]}
<h2 class="text-center text-xl mt-4"> <h2 class="text-center font-semibold text-2xl mb-2 mt-4">
Day {i + 1} - {currentDate.toLocaleDateString('en-US', { timeZone: 'UTC' })} Day {i + 1} - {currentDate.toLocaleDateString('en-US', { timeZone: 'UTC' })}
</h2> </h2>