Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(frontend): Fix checking of `Date` and `NaN` input values (#10781)

Reinier van der Leerb333d5649236
diff --git a/autogpt_platform/frontend/src/lib/utils.ts b/autogpt_platform/frontend/src/lib/utils.ts
index 003a89a118..e273df0629 100644
--- a/autogpt_platform/frontend/src/lib/utils.ts
+++ b/autogpt_platform/frontend/src/lib/utils.ts
@@ -395,7 +395,9 @@ export function isEmpty(value: any): boolean {
return (
value === undefined ||
value === "" ||
- (typeof value === "object" && _isEmpty(value))
+ (typeof value === "object" &&
+ (value instanceof Date ? isNaN(value.getTime()) : _isEmpty(value))) ||
+ (typeof value === "number" && isNaN(value))
);
}