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

Function addMonthsToDateString

src/utils/dateUtils.ts:558–572  ·  view source on GitHub ↗
(dateString: string, months: number)

Source from the content-addressed store, hash-verified

556 * Add months to a date string, returning a date string
557 */
558export function addMonthsToDateString(dateString: string, months: number): string {
559 try {
560 const parsed = parseDateToLocalInternal(dateString);
561 const result = addMonths(parsed, months);
562 return format(result, "yyyy-MM-dd");
563 } catch (error) {
564 tasknotesLogger.error("Error adding months to date string:", {
565 category: "validation",
566 operation: "adding-months-date-string",
567 details: { dateString, months },
568 error: error,
569 });
570 throw error;
571 }
572}
573
574/**
575 * Add years to a date string, returning a date string

Callers

nothing calls this directly

Calls 2

parseDateToLocalInternalFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected