From 0ea9f1d73ecd369197b547cda5477d5030594387 Mon Sep 17 00:00:00 2001 From: Sean Morley Date: Sat, 27 Jul 2024 14:44:15 -0400 Subject: [PATCH] refactor: Update date formatting in CollectionCard and CollectionPage components --- frontend/src/lib/components/CollectionCard.svelte | 4 ++-- frontend/src/routes/collections/[id]/+page.svelte | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/lib/components/CollectionCard.svelte b/frontend/src/lib/components/CollectionCard.svelte index 948bd26..1b6df55 100644 --- a/frontend/src/lib/components/CollectionCard.svelte +++ b/frontend/src/lib/components/CollectionCard.svelte @@ -49,9 +49,9 @@

{collection.adventures.length} Adventures

{#if collection.start_date && collection.end_date}

- 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 - ).toLocaleDateString()} + ).toLocaleDateString('en-US', { timeZone: 'UTC' })}

diff --git a/frontend/src/routes/collections/[id]/+page.svelte b/frontend/src/routes/collections/[id]/+page.svelte index 0efe833..49ba896 100644 --- a/frontend/src/routes/collections/[id]/+page.svelte +++ b/frontend/src/routes/collections/[id]/+page.svelte @@ -238,11 +238,11 @@ {#if collection.start_date && collection.end_date} -

Itinerary

+

Itinerary

{#if numberOfDays} -

Duration: {numberOfDays} days

+

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' })} @@ -257,7 +257,7 @@ dateString ]} -

+

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