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

Function addWeeksToDateString

src/utils/dateUtils.ts:539–553  ·  view source on GitHub ↗
(dateString: string, weeks: number)

Source from the content-addressed store, hash-verified

537 * Add weeks to a date string, returning a date string
538 */
539export function addWeeksToDateString(dateString: string, weeks: number): string {
540 try {
541 const parsed = parseDateToLocalInternal(dateString);
542 const result = addWeeks(parsed, weeks);
543 return format(result, "yyyy-MM-dd");
544 } catch (error) {
545 tasknotesLogger.error("Error adding weeks to date string:", {
546 category: "validation",
547 operation: "adding-weeks-date-string",
548 details: { dateString, weeks },
549 error: error,
550 });
551 throw error;
552 }
553}
554
555/**
556 * Add months to a date string, returning a date string

Callers 1

Calls 2

parseDateToLocalInternalFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected