1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-23 06:49:37 +02:00

Hide end_date when start and end dates are the same

This commit is contained in:
Sean Morley 2024-10-07 19:25:49 -04:00
parent ed37ad45e4
commit 413aa69ac5
2 changed files with 7 additions and 3 deletions

View file

@ -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'
})}
</p>
{#if visit.end_date}
{#if visit.end_date && visit.end_date !== visit.start_date}
<p>
{new Date(visit.end_date).toLocaleDateString(undefined, {
timeZone: 'UTC'