diff --git a/frontend/src/lib/components/AdventureModal.svelte b/frontend/src/lib/components/AdventureModal.svelte index 3f39b3e..33795d6 100644 --- a/frontend/src/lib/components/AdventureModal.svelte +++ b/frontend/src/lib/components/AdventureModal.svelte @@ -221,7 +221,9 @@ let new_end_date: string = ''; let new_notes: string = ''; function addNewVisit() { - // check if start date is before end date + if (new_start_date && !new_end_date) { + new_end_date = new_start_date; + } if (new_start_date > new_end_date) { addToast('error', 'Start date must be before end date'); return; @@ -736,7 +738,7 @@ it would also work to just use on:click on the MapLibre component itself. --> timeZone: 'UTC' })}
- {#if visit.end_date} + {#if visit.end_date && visit.end_date !== visit.start_date}{new Date(visit.end_date).toLocaleDateString(undefined, { timeZone: 'UTC' diff --git a/frontend/src/routes/adventures/[id]/+page.svelte b/frontend/src/routes/adventures/[id]/+page.svelte index 8f8b6fe..70b8075 100644 --- a/frontend/src/routes/adventures/[id]/+page.svelte +++ b/frontend/src/routes/adventures/[id]/+page.svelte @@ -339,7 +339,9 @@ timeZone: 'UTC' }) : ''} - {visit.end_date && visit.end_date !== '' + {visit.end_date && + visit.end_date !== '' && + visit.end_date !== visit.start_date ? ' - ' + new Date(visit.end_date).toLocaleDateString(undefined, { timeZone: 'UTC'