From 71e6432ebc349e48c34f870a3a8ddbb9cdb5569d Mon Sep 17 00:00:00 2001 From: Scott McCarty Date: Fri, 6 Feb 2026 16:35:07 -0500 Subject: [PATCH] Fix incrementPomoBlock to use configured timezone The + button on pomodoro blocks was adding entries in AM instead of PM because it used browser timezone instead of createDateInTimezone(). Co-Authored-By: Claude Opus 4.5 --- templates/index.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/templates/index.html b/templates/index.html index 69ec6b9..c100c25 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1624,6 +1624,8 @@

Edit Pomodoro

// Add a pomodoro of the same type/name on the specified day in a free slot async function incrementPomoBlock(type, name, dayStr, isAM) { + const tz = getEffectiveTimezone(); + // Get the selected duration from settings const duration = settings[`timer_preset_${selectedPreset}`] || 25; @@ -1642,8 +1644,8 @@

Edit Pomodoro

const endMin = isAM ? 0 : workEndMin; // Fetch existing pomodoros for that day to find free slots - const dayStart = new Date(dayStr + 'T00:00:00'); - const dayEnd = new Date(dayStr + 'T23:59:59'); + const dayStart = createDateInTimezone(dayStr, '00:00', tz); + const dayEnd = createDateInTimezone(dayStr, '23:59', tz); try { const existingPomos = await Storage.getPomodoros(dayStart.toISOString(), dayEnd.toISOString()); @@ -1662,7 +1664,8 @@

Edit Pomodoro

for (let timeMinutes = startTimeMinutes; timeMinutes < endTimeMinutes; timeMinutes += 30) { const hour = Math.floor(timeMinutes / 60); const min = timeMinutes % 60; - const slotStart = new Date(dayStr + 'T' + String(hour).padStart(2, '0') + ':' + String(min).padStart(2, '0') + ':00'); + const timeStr = String(hour).padStart(2, '0') + ':' + String(min).padStart(2, '0'); + const slotStart = createDateInTimezone(dayStr, timeStr, tz); const slotEnd = new Date(slotStart.getTime() + duration * 60 * 1000); // Check if this slot overlaps with any existing pomodoro