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

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