@abgov/react-components 6.7.0 → 6.7.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -614,17 +614,18 @@ function GoabDatePicker({
614
614
  }
615
615
  };
616
616
  }, [onChange]);
617
+ const isValidDate = (value2) => value2 && value2 instanceof Date && !isNaN(value2.getTime());
617
618
  return /* @__PURE__ */ jsx(
618
619
  "goa-date-picker",
619
620
  {
620
621
  ref,
621
622
  name,
622
- value: (value == null ? void 0 : value.toISOString()) || "",
623
+ value: isValidDate(value) ? value == null ? void 0 : value.toISOString() : void 0,
623
624
  type,
624
625
  error: error ? "true" : void 0,
625
626
  disabled: disabled ? "true" : void 0,
626
- min: min == null ? void 0 : min.toISOString(),
627
- max: max == null ? void 0 : max.toISOString(),
627
+ min: isValidDate(min) ? min == null ? void 0 : min.toISOString() : void 0,
628
+ max: isValidDate(max) ? max == null ? void 0 : max.toISOString() : void 0,
628
629
  testid: testId,
629
630
  mt,
630
631
  mr,