tududi/frontend/utils
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
..
apiKeysService.ts Fix static base path (#549) 2025-11-16 22:43:06 +02:00
areasService.ts Fix static base path (#549) 2025-11-16 22:43:06 +02:00
attachmentsService.ts Cleanup recurring tasks 2025-12-07 14:12:38 +02:00
authUtils.ts Fix tag validation error messages not shown to user (#861) 2026-02-24 14:49:49 +02:00
backupService.ts Reorder elements (#687) 2025-12-09 10:51:51 +02:00
bannersService.ts Fix today pagination (#596) 2025-11-26 23:00:50 +02:00
dateUtils.test.ts Fix date format inconsistency in Task detail screen (#956) 2026-03-21 18:47:33 +02:00
dateUtils.ts Fix date format inconsistency in Task detail screen (#956) 2026-03-21 18:47:33 +02:00
featureFlags.ts feat: Add MCP Integration with client-agnostic instructions (#953) 2026-03-20 16:55:49 +02:00
fetcher.ts Lint frontend (#131) 2025-07-09 12:23:55 +03:00
habitsService.ts Feat: habits (#707) 2025-12-13 08:47:52 +02:00
inboxService.ts Feat add inbox flow (#676) 2025-12-08 09:21:35 +02:00
keyboardShortcutsService.ts Add custom keyboard shortcuts (#749) 2025-12-28 21:58:21 +02:00
localeUtils.ts Fix date format to respect timezone preference, not just language (#898) (#916) 2026-03-06 15:44:15 +02:00
noteDeleteUtils.ts Fix notes.js & areas.js UID usage and remove IDs. (#355) 2025-09-29 16:03:46 +03:00
notesService.ts Fix note creation with project assignment (#927) 2026-03-09 23:14:44 +02:00
profileService.ts Clear local storage on selection (#795) 2026-01-23 23:54:04 +02:00
projectsService.ts Fix static base path (#549) 2025-11-16 22:43:06 +02:00
searchService.ts Reorder elements (#687) 2025-12-09 10:51:51 +02:00
sharesService.ts Fix bug 661 (#682) 2025-12-08 16:14:10 +02:00
slugUtils.ts Setup slugify and fix nanoid issues 2025-08-08 23:14:40 +03:00
tagsService.ts Fix static base path (#549) 2025-11-16 22:43:06 +02:00
taskEventService.ts Fix bump issues (#651) 2025-12-04 18:19:40 +02:00
taskIntelligenceService.ts Lint frontend (#131) 2025-07-09 12:23:55 +03:00
taskSortUtils.ts Fix in progress today priority 2025-12-14 09:07:39 +02:00
tasksService.ts Fix recurring tasks losing name and subtasks on status change (#886) 2026-03-01 13:17:54 +02:00
timezoneUtils.ts fixup! Scaffold timezone package 2025-10-20 16:01:49 +03:00
urlService.ts Fix an issue with breaking inbox input on long strings (#823) 2026-02-07 09:03:13 +02:00
userUtils.ts Tweak UI for feature 2025-10-13 11:09:19 +03:00