@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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@firecms/ui",
3
3
  "type": "module",
4
- "version": "3.1.0-canary.24c8270",
4
+ "version": "3.1.0-canary.75005e4",
5
5
  "description": "Awesome Firebase/Firestore-based headless open-source CMS",
6
6
  "funding": {
7
7
  "url": "https://github.com/sponsors/firecmsco"
@@ -114,7 +114,7 @@
114
114
  "index.css",
115
115
  "tailwind.config.js"
116
116
  ],
117
- "gitHead": "fa98925bad34308ed66e7ea68adcc07eb38184ae",
117
+ "gitHead": "c29532edd82a7516124856d79871c05c07989d04",
118
118
  "publishConfig": {
119
119
  "access": "public"
120
120
  }
@@ -51,7 +51,7 @@ export const DateTimeField: React.FC<DateTimeFieldProps> = ({
51
51
  const [focused, setFocused] = useState(false);
52
52
  const [internalValue, setInternalValue] = useState<string>("");
53
53
  const [isTyping, setIsTyping] = useState(false);
54
- const invalidValue = value !== undefined && value !== null && !(value instanceof Date);
54
+ const invalidValue = value !== undefined && value !== null && (!(value instanceof Date) || isNaN((value as Date).getTime()));
55
55
 
56
56
  useInjectStyles("DateTimeField", inputStyles);
57
57
 
@@ -84,7 +84,12 @@ export const DateTimeField: React.FC<DateTimeFieldProps> = ({
84
84
  };
85
85
 
86
86
  const formatter = new Intl.DateTimeFormat("en-CA", options);
87
- const parts = formatter.formatToParts(dateValue);
87
+ let parts: Intl.DateTimeFormatPart[];
88
+ try {
89
+ parts = formatter.formatToParts(dateValue);
90
+ } catch {
91
+ return "";
92
+ }
88
93
 
89
94
  const getPart = (type: string) => parts.find(p => p.type === type)?.value ?? "";
90
95