Date Fixes, Translations, Misc Bugs (#840)

* Translated using Weblate (Spanish)

Currently translated at 100.0% (956 of 956 strings)

Translation: AdventureLog/Web App
Translate-URL: https://hosted.weblate.org/projects/adventurelog/web-app/es/

* Added translation using Weblate (English (United States))

* Translated using Weblate (Norwegian Bokmål)

Currently translated at 100.0% (956 of 956 strings)

Translation: AdventureLog/Web App
Translate-URL: https://hosted.weblate.org/projects/adventurelog/web-app/nb_NO/

* Remove empty English (United States) locale file

* Translated using Weblate (Spanish)

Currently translated at 100.0% (956 of 956 strings)

Translation: AdventureLog/Web App
Translate-URL: https://hosted.weblate.org/projects/adventurelog/web-app/es/

* [BUG]Ordered Itinerary includes visits that are outside itinerary date range
Fixes #746

* [BUG] Server Error (500) when trying to access the API docs
Fixes #712

* [BUG] Single day Collections will think location visits are out of date range
Fixes #827

* Fixes #654

* Translated using Weblate (Spanish)

Currently translated at 100.0% (956 of 956 strings)

Translation: AdventureLog/Web App
Translate-URL: https://hosted.weblate.org/projects/adventurelog/web-app/es/

* Added Slovak translations (#815)

* Created sk.json

* Update Navbar.svelte

* Update +layout.svelte

---------

Co-authored-by: Sean Morley <98704938+seanmorley15@users.noreply.github.com>

* Implement code changes to enhance functionality and improve performance

---------

Co-authored-by: Nikolai Eidsheim <nikolai.eidsheim@gmail.com>
Co-authored-by: Sergio <garcia.sergio@me.com>
Co-authored-by: fantastron27 <fantastron27@gmail.com>
This commit is contained in:
Sean Morley
2025-09-06 21:45:40 -04:00
committed by GitHub
parent 4a53b1fdfd
commit 96dfda1cfb
31 changed files with 5343 additions and 4242 deletions

View File

@@ -20,6 +20,7 @@
register('ja', () => import('../locales/ja.json'));
register('ar', () => import('../locales/ar.json'));
register('pt-br', () => import('../locales/pt-br.json'));
register('sk', () => import('../locales/sk.json'));
let locales = [
'en',
@@ -36,7 +37,8 @@
'ru',
'ja',
'ar',
'pt-br'
'pt-br',
'sk'
];
if (browser) {

View File

@@ -389,6 +389,21 @@
});
}
$: filteredOrderedItems = orderedItems.filter((item) => {
if (!collection?.start_date || !collection?.end_date) {
return true; // If no date range is set, show all items
}
const collectionStart = new Date(collection.start_date);
const collectionEnd = new Date(collection.end_date);
const itemStart = new Date(item.start);
const itemEnd = new Date(item.end);
// Check if item overlaps with collection date range
// Item is included if it starts before collection ends AND ends after collection starts
return itemStart <= collectionEnd && itemEnd >= collectionStart;
});
$: {
numAdventures = adventures.length;
numVisited = adventures.filter((adventure) => adventure.is_visited).length;
@@ -1176,11 +1191,11 @@
<div class="flex flex-col items-center">
<div class="w-full max-w-4xl relative">
<!-- Vertical timeline line that spans the entire height -->
{#if orderedItems.length > 0}
{#if filteredOrderedItems.length > 0}
<div class="absolute left-8 top-0 bottom-0 w-1 bg-primary"></div>
{/if}
<ul class="relative">
{#each orderedItems as orderedItem, index}
{#each filteredOrderedItems as orderedItem, index}
<li class="relative pl-20 mb-8">
<!-- Timeline Icon -->
<div
@@ -1281,7 +1296,7 @@
</li>
{/each}
</ul>
{#if orderedItems.length === 0}
{#if filteredOrderedItems.length === 0}
<div class="alert alert-info">
<p class="text-center text-lg">{$t('adventures.no_ordered_items')}</p>
</div>
@@ -1360,7 +1375,7 @@
</Marker>
{/if}
{/each}
{#if lineData}
{#if lineData && collection.start_date && collection.end_date}
<GeoJSON data={lineData}>
<LineLayer
layout={{ 'line-cap': 'round', 'line-join': 'round' }}