mirror of
https://github.com/lingble/chatwoot.git
synced 2025-11-02 03:57:52 +00:00
The `matchesFilter` is a utility that checks the incoming payload against a filter and returns `true` or `false`. For the `greater_than` and `less_than` filter specifically, the date parsing would fail when the timestamp was a 10 digit number. This PR solves this by adding a `coerceToDate` method that tries to parse the given value to a Date object as correctly as possible before comparing. Ref: https://github.com/chatwoot/utils/pull/53