You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a MySQL entity with a dueDate column of type date and if I use a request with filter dueDate||$eq||2022-04-22 I do not get any results even though there are values in the database. I looked at the TypeORM logs and I saw that the request was akin to SELECT * FROM Task WHERE dueDate = '2022-04-22T00:00:00.000Z'.
The string 2022-04-22 is getting turned into 2022-04-22T00:00:00.000Z which means that the $eq operator will never work.
Expected behavior
I would like to be able to use the MySQL date column and be able to use $lt, $lte, $eq, $gte, $gt to filter out results based on the date.
Possible Solution
I dove into the code and found that commenting out the following block results in the expected behavior.
Is there a way to control this behavior with an option on the crud controller or with an override? I had tried overwriting the value in the filter in an override
Bug Report
Current behavior
I have a MySQL entity with a
dueDate
column of typedate
and if I use a request with filterdueDate||$eq||2022-04-22
I do not get any results even though there are values in the database. I looked at the TypeORM logs and I saw that the request was akin toSELECT * FROM Task WHERE dueDate = '2022-04-22T00:00:00.000Z'
.The string
2022-04-22
is getting turned into2022-04-22T00:00:00.000Z
which means that the$eq
operator will never work.Expected behavior
I would like to be able to use the MySQL
date
column and be able to use$lt, $lte, $eq, $gte, $gt
to filter out results based on the date.Possible Solution
I dove into the code and found that commenting out the following block results in the expected behavior.
crud/packages/crud-request/src/request-query.parser.ts
Lines 205 to 207 in 43cf665
Is there a way to control this behavior with an option on the crud controller or with an override? I had tried overwriting the value in the filter in an override
but even this did not work.
Environment
Repository with minimal reproduction
The text was updated successfully, but these errors were encountered: