From a9564c513ac38d3afaa025feb781e99affc5ca7f Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Tue, 2 Sep 2025 09:52:25 +0000 Subject: [PATCH] Adjust task date handling to correctly manage start and end dates Modify the task creation logic in `TasksSimplified.tsx` to properly initialize `startDate` to null and ensure `dueDate` is set to null when not provided, resolving an issue with date range selection. Replit-Commit-Author: Agent Replit-Commit-Session-Id: f2b9c241-9fdd-4abd-9041-720afc8b27d6 Replit-Commit-Checkpoint-Type: full_checkpoint --- ...tings-New--1756806583128_1756806583129.txt | 237 ++++++++++++++++++ client/src/pages/TasksSimplified.tsx | 3 +- 2 files changed, 239 insertions(+), 1 deletion(-) create mode 100644 attached_assets/Pasted--User-related-Environment-related-Registries-Logs-Notifications-Settings-New--1756806583128_1756806583129.txt diff --git a/attached_assets/Pasted--User-related-Environment-related-Registries-Logs-Notifications-Settings-New--1756806583128_1756806583129.txt b/attached_assets/Pasted--User-related-Environment-related-Registries-Logs-Notifications-Settings-New--1756806583128_1756806583129.txt new file mode 100644 index 0000000..ee6cdbd --- /dev/null +++ b/attached_assets/Pasted--User-related-Environment-related-Registries-Logs-Notifications-Settings-New--1756806583128_1756806583129.txt @@ -0,0 +1,237 @@ + + +User-related + + +Environment-related + +Registries + +Logs + +Notifications + +Settings + +New version available 2.33.1 +DismissSee what's new +Community Edition +2.27.6 LTS +Containers>logiflow-logiflow-1>Logs +Container logs + + +admin +Log viewer settings +Auto-refresh logs +Wrap lines +Display timestamps +Fetch +All logs +Search +Filter... +Lines +100 +Actions + + + + + title: 'Rangement et faire prix podium Meuble', + + description: 'Rangement et faire prix podium Meuble', + + priority: 'medium', + + status: 'pending', + + assignedTo: 'Non assigné', + + startDate: null, + + dueDate: null, + + groupId: 2, + + createdBy: 'admin_local' + + }, + + dueDate: null, + + dueDateType: 'object', + + dueDateValue: null + +} + +💾 DatabaseStorage.createTask - Input: { + + taskData: { + + title: 'Rangement et faire prix podium Meuble', + + description: 'Rangement et faire prix podium Meuble', + + priority: 'medium', + + status: 'pending', + + assignedTo: 'Non assigné', + + startDate: null, + + dueDate: null, + + groupId: 2, + + createdBy: 'admin_local' + + }, + + dueDate: null, + + dueDateType: 'object', + + dueDateISO: null + +} + +💾 DatabaseStorage.createTask - Result: { + + taskId: 107, + + title: 'Rangement et faire prix podium Meuble', + + dueDate: null, + + dueDateType: 'object' + +} + +✅ Task created: { + + id: 107, + + title: 'Rangement et faire prix podium Meuble', + + dueDate: null, + + dueDateType: 'object' + +} + +POST /api/tasks 200 in 7ms + +📄 SPA: Serving index.html for /tasks + +GET /api/user 304 in 4ms + +🗓️ [DATE-CALC] Aujourd'hui: 2025-09-02 (Mardi) + +🗓️ [DATE-CALC] Année précédente: 2024-09-03 (Mardi) + +GET /api/user 304 in 11ms + +🌤️ [RESPONSE] Weather data prepared: { + + hasCurrentYear: true, + + hasPreviousYear: true, + + location: 'Frouard, France' + +} + +GET /api/weather/current 304 in 12ms + +GET /api/user 304 in 3ms + +GET /api/user 304 in 7ms + +GET /api/users 304 in 14ms + +GET /api/groups 304 in 6ms + +🔍 Admin tasks filtering: { storeId: '2', groupIds: [ 2 ], message: 'Filtering by store 2' } + +🔍 Tasks API called with: { + + groupIds: [ 2 ], + + userRole: 'admin', + + userId: 'admin_local', + + requestedStoreId: '2', + + userGroups: 'all', + + timestamp: '2025-09-02T09:49:55.103Z' + +} + +📋 DatabaseStorage.getTasks - Raw results: { + + resultCount: 1, + + userRole: 'admin', + + sampleTasks: [ + + { + + taskExists: true, + + taskId: 107, + + title: 'Rangement et faire prix podium Meuble', + + startDate: null, + + groupExists: true + + } + + ] + +} + +📋 Tasks returned: { + + count: 1, + + userId: 'admin_local', + + userRole: 'admin', + + requestedStoreId: '2', + + groupIds: [ 2 ], + + taskGroups: [ + + { + + id: 107, + + title: 'Rangement et faire prix podium Meuble', + + groupId: 2 + + } + + ] + +} + +GET /api/tasks 200 in 9ms + +GET /api/weather/current 401 in 2ms + +📄 SPA: Serving index.html for /auth + +GET /api/user 401 in 1ms + +GET /api/user 401 in 3ms + diff --git a/client/src/pages/TasksSimplified.tsx b/client/src/pages/TasksSimplified.tsx index 0f1728e..cfb9a1b 100644 --- a/client/src/pages/TasksSimplified.tsx +++ b/client/src/pages/TasksSimplified.tsx @@ -418,7 +418,8 @@ function TaskForm({ onSubmit, initialData, isEditing = false }: { description: description.trim() || undefined, assignedTo: assignedTo?.trim() || "Non assigné", priority, - dueDate: dueDate ? new Date(dueDate).toISOString() : undefined, + startDate: null, // Toujours inclure startDate même si null + dueDate: dueDate ? new Date(dueDate).toISOString() : null, }; onSubmit(taskData);