MCPcopy
hub / github.com/callumalpass/tasknotes / formatDateForDisplay

Function formatDateForDisplay

src/utils/dateUtils.ts:744–757  ·  view source on GitHub ↗
(dateString: string, formatString = "MMM d, yyyy")

Source from the content-addressed store, hash-verified

742 * Format a date string for user display
743 */
744export 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

Callers 7

getTaskContextInfoMethod · 0.90
renderAddReminderFormMethod · 0.90
formatReminderDetailsMethod · 0.90
createNoteCardFunction · 0.90
updateNoteCardFunction · 0.90
dateUtils.test.tsFile · 0.90

Calls 2

parseDateToLocalInternalFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected