[Bug]: To-Dos Table View shows due date shifted +1 day ahead due to unlocalized raw DateTime parsing in showAll.blade.php
Author: maruf-pfcCreated Sep 14, 2026Updated Sep 14, 2026
What is your set up?
Self Hosted Docker
Version
v3.9.8 (current master branch)
Describe the issue
When setting a task due date (e.g., September 14 or September 20), the Table View (/tickets/showAll) displays the due date shifted +1 day ahead (e.g., September 15 or September 21).
However:
- The Kanban View (
/tickets/showKanban) displays the correct date. - The Ticket Details Modal displays the correct date.
- The Telegram / Messenger Notifications display the correct date.
Only the Table View shows the incorrect shifted date.
Root Cause Analysis:
- When a task is saved with a due date,
Tickets::prepareTicketDates()converts the user's local end-of-day (23:59:59) into UTC for database storage (dateToFinish). For any timezone behind UTC (or when local end-of-day rolls past UTC midnight), this is stored as the next morning in UTC (e.g.,2026-09-21 06:59:59). - Everywhere else (Kanban, Ticket Modal, Telegram notifications), Leantime converts the UTC timestamp back to the user's timezone using
format($dateToFinish)->date()ordtHelper()->parseDbDateTime($dateToFinish)->formatDateForUser(). - In
app/Domain/Tickets/Templates/showAll.blade.php(lines 318–319), raw PHPnew DateTime($row['dateToFinish'])is used without timezone conversion:Because$date = new DateTime($row['dateToFinish']); $date = $date->format(__('language.dateformat'));new DateTime()treats the raw string as-is without user timezone translation,2026-09-21 06:59:59is formatted directly as09/21/2026instead of converting back to09/20/2026.
Affected Files:
app/Domain/Tickets/Templates/showAll.blade.php(lines 315–321)app/Domain/Tickets/Templates/submodules/subTasks.blade.php(lines 36–42)
Suggested Fix:
Replace the manual new DateTime() formatting in showAll.blade.php and subTasks.blade.php with the standard Leantime format() helper (matching showKanban.blade.php and partials/ticketCard.blade.php):
--- a/app/Domain/Tickets/Templates/showAll.blade.php
+++ b/app/Domain/Tickets/Templates/showAll.blade.php
@@ -314,9 +314,7 @@
@php
if ($row['dateToFinish'] == '0000-00-00 00:00:00' || $row['dateToFinish'] == '1969-12-31 00:00:00') {
$date = __('text.anytime');
} else {
- $date = new DateTime($row['dateToFinish']);
- $date = $date->format(__('language.dateformat'));
+ $date = format($row['dateToFinish'])->date();
}
@endphpReproduction steps
- Open any project and go to To-Dos (
/tickets/showKanbanor/tickets/showAll). - Create or edit a task and set its due date to
September 20, 2026. - Check the Telegram notification or open the task details modal: it correctly says
09/20/2026. - Switch to the Table View tab (
/tickets/showAll): the Due Date column displays09/21/2026(+1 day discrepancy).
Error Logs (LEANTIMEFOLDER/storage/logs)
Database stored value:
SELECT id, headline, dateToFinish FROM zp_tickets WHERE id = 208;
-- Output: 208 | NTRCA 100 MCQ - 7th | 2026-09-21 06:59:59Source: Leantime/leantime