From 36f902287221be0a70993ed6fd9153e48445db03 Mon Sep 17 00:00:00 2001 From: Sean Morley Date: Thu, 19 Jun 2025 11:33:04 -0400 Subject: [PATCH] fix(lodging): remove console log and improve all-day event checks in lodging modal --- frontend/src/lib/components/LodgingModal.svelte | 2 -- frontend/src/lib/config.ts | 2 +- frontend/src/lib/index.ts | 8 +++----- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/frontend/src/lib/components/LodgingModal.svelte b/frontend/src/lib/components/LodgingModal.svelte index 6eb97a2..c7a3fd9 100644 --- a/frontend/src/lib/components/LodgingModal.svelte +++ b/frontend/src/lib/components/LodgingModal.svelte @@ -87,8 +87,6 @@ lodging.timezone = lodgingTimezone || null; - console.log(lodgingTimezone); - // Auto-set end date if missing but start date exists if (lodging.check_in && !lodging.check_out) { if (isAllDay(lodging.check_in)) { diff --git a/frontend/src/lib/config.ts b/frontend/src/lib/config.ts index a9893c2..6772b0a 100644 --- a/frontend/src/lib/config.ts +++ b/frontend/src/lib/config.ts @@ -1,4 +1,4 @@ -export let appVersion = 'v0.10.0-main-06182025'; +export let appVersion = 'v0.10.0-main-06192025'; export let versionChangelog = 'https://github.com/seanmorley15/AdventureLog/releases/tag/v0.10.0'; export let appTitle = 'AdventureLog'; export let copyrightYear = '2023-2025'; diff --git a/frontend/src/lib/index.ts b/frontend/src/lib/index.ts index 21bee80..18549a6 100644 --- a/frontend/src/lib/index.ts +++ b/frontend/src/lib/index.ts @@ -81,8 +81,8 @@ export function groupAdventuresByDate( adventure.visits.forEach((visit) => { if (visit.start_date) { // Check if it's all-day: start has 00:00:00 AND (no end OR end also has 00:00:00) - const startHasZeros = visit.start_date.includes('T00:00:00'); - const endHasZeros = visit.end_date ? visit.end_date.includes('T00:00:00') : true; + const startHasZeros = isAllDay(visit.start_date); + const endHasZeros = visit.end_date ? isAllDay(visit.end_date) : true; const isAllDayEvent = startHasZeros && endHasZeros; let startDT: DateTime; @@ -93,9 +93,7 @@ export function groupAdventuresByDate( const dateOnly = visit.start_date.split('T')[0]; // Get 'YYYY-MM-DD' startDT = DateTime.fromISO(dateOnly); // This creates a date without time/timezone - endDT = visit.end_date - ? DateTime.fromISO(visit.end_date.split('T')[0]) - : startDT; + endDT = visit.end_date ? DateTime.fromISO(visit.end_date.split('T')[0]) : startDT; } else { // For timed events, use timezone conversion startDT = DateTime.fromISO(visit.start_date, {