@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.js CHANGED
@@ -616,17 +616,18 @@ function GoabDatePicker({
616
616
  }
617
617
  };
618
618
  }, [onChange]);
619
+ const isValidDate = (value2) => value2 && value2 instanceof Date && !isNaN(value2.getTime());
619
620
  return /* @__PURE__ */ jsxRuntime.jsx(
620
621
  "goa-date-picker",
621
622
  {
622
623
  ref,
623
624
  name,
624
- value: (value == null ? void 0 : value.toISOString()) || "",
625
+ value: isValidDate(value) ? value == null ? void 0 : value.toISOString() : void 0,
625
626
  type,
626
627
  error: error ? "true" : void 0,
627
628
  disabled: disabled ? "true" : void 0,
628
- min: min == null ? void 0 : min.toISOString(),
629
- max: max == null ? void 0 : max.toISOString(),
629
+ min: isValidDate(min) ? min == null ? void 0 : min.toISOString() : void 0,
630
+ max: isValidDate(max) ? max == null ? void 0 : max.toISOString() : void 0,
630
631
  testid: testId,
631
632
  mt,
632
633
  mr,