tududi/frontend/components/Task/TaskDetails
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
..
index.ts Fix refactor pt2 (#734) 2025-12-27 17:46:34 +02:00
TaskAttachmentsCard.tsx Fix attachments layout 2025-12-07 14:12:38 +02:00
TaskContentCard.tsx Feat refactor task details (#660) 2025-12-06 09:41:58 +02:00
TaskDeferUntilCard.tsx Fix date format inconsistency in Task detail screen (#956) 2026-03-21 18:47:33 +02:00
TaskDetailsHeader.tsx Fix new task in mobile (#857) 2026-02-24 13:03:38 +02:00
TaskDueDateCard.tsx Fix date format inconsistency in Task detail screen (#956) 2026-03-21 18:47:33 +02:00
TaskProjectCard.tsx Feat refactor task details (#660) 2025-12-06 09:41:58 +02:00
TaskRecurrenceCard.tsx Fix date format to respect timezone preference, not just language (#898) (#916) 2026-03-06 15:44:15 +02:00
TaskRecurringInstanceInfo.tsx Cleanup recurring tasks 2025-12-07 14:12:38 +02:00
TaskSubtasksCard.tsx Fix saving subtasks on edit (#806) 2026-01-31 08:29:44 +02:00
TaskTagsCard.tsx Feat refactor task details (#660) 2025-12-06 09:41:58 +02:00