Skip to content

Fix dateTime filtering operators producing incorrect results#16

Closed
kac-axelor wants to merge 2 commits intoaxelor:devfrom
kac-axelor:date-time-fix
Closed

Fix dateTime filtering operators producing incorrect results#16
kac-axelor wants to merge 2 commits intoaxelor:devfrom
kac-axelor:date-time-fix

Conversation

@kac-axelor
Copy link
Copy Markdown
Contributor

@kac-axelor kac-axelor commented Mar 13, 2026

  • DateTime comparison operators were not working correctly when filtering by DateTime fields
  • Root cause: cleanResult used JSON.parse(JSON.stringify(...)) which serialized Date objects to ISO strings, causing TypeORM to receive strings instead of Date instances as query parameters
  • Fix: replaced the JSON round-trip with a manual recursive clean function that correctly handles all supported field types — preserving Date and Buffer instances for the pg driver, and calling toJSON() on custom types like BigDecimal to avoid double-serialization

- This preserves date and big decimal from being stringified
- fixes axelor#15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants