mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-23 14:59:36 +02:00
Hide end_date when start and end dates are the same
This commit is contained in:
parent
ed37ad45e4
commit
413aa69ac5
2 changed files with 7 additions and 3 deletions
|
@ -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'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue