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

Function addYearsToDateString

src/utils/dateUtils.ts:577–591  ·  view source on GitHub ↗
(dateString: string, years: number)

Source from the content-addressed store, hash-verified

575 * Add years to a date string, returning a date string
576 */
577export function addYearsToDateString(dateString: string, years: number): string {
578 try {
579 const parsed = parseDateToLocalInternal(dateString);
580 const result = addYears(parsed, years);
581 return format(result, "yyyy-MM-dd");
582 } catch (error) {
583 tasknotesLogger.error("Error adding years to date string:", {
584 category: "validation",
585 operation: "adding-years-date-string",
586 details: { dateString, years },
587 error: error,
588 });
589 throw error;
590 }
591}
592
593/**
594 * Get start of week for today, returning a date string

Callers

nothing calls this directly

Calls 2

parseDateToLocalInternalFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected