tududi/frontend/components/Task
Chris 2444e36f47
Fix date format inconsistency in Task detail screen (#956)
* Fix date format inconsistency in Task detail screen (#938)

Replace browser-dependent toLocaleDateString() with explicit country-based
date formatting to ensure consistent date formats based on user's timezone.

Problem:
- User with English language + Greek timezone saw MM/DD/YYYY format
- Expected DD/MM/YYYY format based on timezone/country
- Browser's Intl.DateTimeFormat had incomplete locale support for
  combined locales like "en-GR"

Solution:
- Add country-to-format mapping in dateUtils.ts (60+ countries)
- New formatDateByCountry() for dates (DD/MM/YYYY, MM/DD/YYYY, YYYY/MM/DD)
- New formatDateTimeByCountry() for datetimes with 24h time
- Update TaskDueDateCard and TaskDeferUntilCard to use new functions
- Uses date-fns for consistent cross-browser formatting

Testing:
- Added 40 comprehensive test cases covering all format types
- Verified with Greece (DD/MM), US (MM/DD), Japan (YYYY/MM/DD)
- All tests passing

Fixes #938

* chore: remove unused import in dateUtils.ts
2026-03-21 18:47:33 +02:00
..
TaskDetails Fix date format inconsistency in Task detail screen (#956) 2026-03-21 18:47:33 +02:00
TaskForm Fix subtask completion not persisting to backend (#920) (#936) 2026-03-10 17:30:45 +02:00
getDescription.ts Limit recurring tasks in tasks list view (#298) 2025-09-04 17:00:33 +03:00
getTitleAndIcon.ts Limit recurring tasks in tasks list view (#298) 2025-09-04 17:00:33 +03:00
GroupedTaskList.tsx Fix refactor pt2 (#734) 2025-12-27 17:46:34 +02:00
NewTask.tsx Tc refactor pt1 (#589) 2025-11-23 21:48:49 +02:00
NextTaskSuggestion.tsx Fix bug 733 (#735) 2025-12-27 21:00:52 +02:00
RecurrenceDisplay.tsx Add tooltips (#744) 2025-12-28 12:03:50 +02:00
statusStyles.ts Cleanup statuses (#724) 2025-12-19 11:13:27 +02:00
TaskDetails.tsx Fix defer date validation for recurring task instances (#910) 2026-03-05 08:20:30 +02:00
TaskDueDate.tsx Fix timezone missed rollout (#832) 2026-02-10 22:28:14 +02:00
TaskHeader.tsx Fix subtask icons invisible on Today page (#839) (#935) 2026-03-10 17:15:06 +02:00
TaskItem.tsx Fix redirect after task deletion to return to originating view (#887) 2026-03-01 16:07:02 +02:00
TaskList.tsx Fix recur instance done (#727) 2025-12-19 17:37:04 +02:00
TaskStatusControl.tsx Fix status dropdown z-index behind subtasks in project view (#866) 2026-02-26 19:53:59 +02:00
TasksToday.tsx Fix date comparison bugs causing false past due warnings and Today view miscategorization (#826) 2026-02-07 22:40:33 +02:00
TaskTags.tsx Change tags to use uids instead of ids. (#351) 2025-09-22 17:10:29 +03:00
TaskTimeline.tsx Fix timezone missed rollout (#832) 2026-02-10 22:28:14 +02:00
TodayPlan.tsx Introduce sort utils (#709) 2025-12-14 01:13:57 +02:00
TodaySettingsDropdown.tsx Fix static base path (#549) 2025-11-16 22:43:06 +02:00
WeeklyCompletionChart.tsx Fix metrics styling (#647) 2025-12-04 13:42:05 +02:00