(dateString: string, formatString = "MMM d, yyyy")
| 742 | * Format a date string for user display |
| 743 | */ |
| 744 | export function formatDateForDisplay(dateString: string, formatString = "MMM d, yyyy"): string { |
| 745 | try { |
| 746 | const parsed = parseDateToLocalInternal(dateString); |
| 747 | return format(parsed, formatString); |
| 748 | } catch (error) { |
| 749 | tasknotesLogger.error("Error formatting date for display:", { |
| 750 | category: "validation", |
| 751 | operation: "formatting-date-display", |
| 752 | details: { dateString }, |
| 753 | error: error, |
| 754 | }); |
| 755 | return dateString; // Return original if formatting fails |
| 756 | } |
| 757 | } |
| 758 | |
| 759 | /** |
| 760 | * Get current timestamp in local timezone ISO format for consistent timestamp generation |
no test coverage detected