MCPcopy Create free account
hub / github.com/chhoumann/quickadd / formatISODate

Function formatISODate

src/utils/dateParser.ts:70–85  ·  view source on GitHub ↗
(isoString: string, format: string)

Source from the content-addressed store, hash-verified

68 * @returns The formatted date string or null if invalid
69 */
70export function formatISODate(isoString: string, format: string): string | null {
71 if (!window.moment) {
72 return null;
73 }
74
75 try {
76 const moment = window.moment(isoString);
77 if (moment.isValid()) {
78 return moment.format(format);
79 }
80 } catch {
81 // Invalid date - return null
82 }
83
84 return null;
85}

Callers 7

GetApiMethod · 0.90
datePromptMethod · 0.90
dateParser.test.tsFile · 0.90
datePromptMethod · 0.90
formatIsoForInputMethod · 0.90
renderFieldMethod · 0.90
formatIsoForDisplayMethod · 0.90

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected