fix: date formatting errors with invalid (empty) dates (#636)
Description
Problem: RangeError: Invalid time value errors occurred when processing branches with empty or invalid dataStateAt dates.
Solution:
- Enhanced formatDateToISO function with better validation
- Created reusable formatDateWithDistance and formatDistanceSafe utilities
- Updated all components to use safe date formatting functions
- Replaced complex IIFE patterns with simple utility calls
Related issue
Examples
Checklist
-
MR description has been reviewed -
MR changes are functionally tested -
MR does NOT have API/CLI changes OR there are API/CLI changes and they have been reviewed & DOCS ARE ADJUSTED (reference doc, etc) -
MR does NOT have UI changes OR there are UI changes and they have been reviewed & UX IS REVIEWED
Closes #636 (closed)