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

Function validateDateInput

src/utils/dateUtils.ts:504–515  ·  view source on GitHub ↗
(dateValue: string)

Source from the content-addressed store, hash-verified

502 * Enhanced date validation that accepts both date-only and timezone-aware formats
503 */
504export function validateDateInput(dateValue: string): boolean {
505 if (!dateValue || dateValue.trim() === "") {
506 return true; // Empty is valid (optional field)
507 }
508
509 try {
510 parseDateToLocalInternal(dateValue);
511 return true;
512 } catch {
513 return false;
514 }
515}
516
517/**
518 * Add days to a date string, returning a date string

Callers 2

dateUtils.test.tsFile · 0.90
validateDateTimeInputFunction · 0.85

Calls 1

parseDateToLocalInternalFunction · 0.85

Tested by

no test coverage detected