Fix searcing for a date on a string field.

This commit is contained in:
Sam Rose 2025-02-05 11:26:33 +00:00
parent cc3d087e82
commit 38fce3ac3e
No known key found for this signature in database
2 changed files with 7 additions and 1 deletions

View File

@ -388,7 +388,7 @@ class InternalBuilder {
}
}
if (typeof input === "string") {
if (typeof input === "string" && schema.type === FieldType.DATETIME) {
if (isInvalidISODateString(input)) {
return null
}

View File

@ -1040,6 +1040,12 @@ if (descriptions.length) {
string: { name: "FO" },
}).toContainExactly([{ name: "foo" }])
})
it("should not coerce string to date for string columns", async () => {
await expectQuery({
string: { name: "2020-01-01" },
}).toFindNothing()
})
})
describe("range", () => {