@firecms/ui 3.1.0-canary.24c8270 → 3.1.0-canary.75005e4

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/dist/index.umd.js CHANGED
@@ -32943,7 +32943,7 @@
32943
32943
  const [focused, setFocused] = React.useState(false);
32944
32944
  const [internalValue, setInternalValue] = React.useState("");
32945
32945
  const [isTyping, setIsTyping] = React.useState(false);
32946
- const invalidValue = value !== void 0 && value !== null && !(value instanceof Date);
32946
+ const invalidValue = value !== void 0 && value !== null && (!(value instanceof Date) || isNaN(value.getTime()));
32947
32947
  useInjectStyles("DateTimeField", inputStyles);
32948
32948
  const handleClear = (e) => {
32949
32949
  e.preventDefault();
@@ -32966,7 +32966,12 @@
32966
32966
  // undefined = local timezone
32967
32967
  };
32968
32968
  const formatter = new Intl.DateTimeFormat("en-CA", options);
32969
- const parts = formatter.formatToParts(dateValue);
32969
+ let parts;
32970
+ try {
32971
+ parts = formatter.formatToParts(dateValue);
32972
+ } catch {
32973
+ return "";
32974
+ }
32970
32975
  const getPart = (type) => parts.find((p) => p.type === type)?.value ?? "";
32971
32976
  const year = getPart("year");
32972
32977
  const month = getPart("month");