diff --git a/package.json b/package.json index f833b1f..42605f6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "my-weekly-todo-list", - "version": "1.81.15", + "version": "1.81.16", "description": "A web-based weekly task management application that organizes to-dos and calendar events in a single, intuitive weekly view", "main": "index.js", "scripts": { diff --git a/src/components/WeeklyView.tsx b/src/components/WeeklyView.tsx index 41c9a4f..0a88379 100644 --- a/src/components/WeeklyView.tsx +++ b/src/components/WeeklyView.tsx @@ -196,7 +196,7 @@ export interface SomedayList { } // Time grid configuration options -export type CellDuration = 15 | 20 | 30 | 60; +export type CellDuration = 15 | 20 | 30 | 45 | 60; const DEFAULT_SOMEDAY_SLOT_COUNT = 5; const getSomedaySlotCount = (tasks: Task[]) => { @@ -339,14 +339,12 @@ function getTimeSlots( endHour: number, ): string[] { const slots: string[] = []; - const slotsPerHour = 60 / cellDuration; - for (let hour = startHour; hour < endHour; hour++) { - for (let slot = 0; slot < slotsPerHour; slot++) { - const minutes = slot * cellDuration; - slots.push( - `${hour.toString().padStart(2, "0")}:${minutes.toString().padStart(2, "0")}`, - ); - } + const startMins = startHour * 60; + const endMins = endHour * 60; + for (let mins = startMins; mins < endMins; mins += cellDuration) { + const h = Math.floor(mins / 60); + const m = mins % 60; + slots.push(`${h.toString().padStart(2, "0")}:${m.toString().padStart(2, "0")}`); } return slots; } @@ -1460,6 +1458,7 @@ export default function WeeklyView() { case 15: return 25; case 20: return 30; case 30: return 35; + case 45: return 45; case 60: return 50; default: return 50; } @@ -5451,7 +5450,7 @@ export default function WeeklyView() { {profile.language === "de" ? "Zeitfenster" : "Slot"}