(dateString: string, months: number)
| 556 | * Add months to a date string, returning a date string |
| 557 | */ |
| 558 | export 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 |
nothing calls this directly
no test coverage detected