Fixed before/after + date_format rules logic

This fixes another missing feature explained in PR #4699. Should be Ok now.

First it tries to find if an attribute was passed to `$parameters[0]`. If not, will assume that a parsable date was passed.
Then it'll try to create `DateTime` objects for the given `$value` and `$param`. If it fails to create a `DateTime` object for `$param`, then it'll assume it's a relative date parsable by `DateTime` constructor (which works exactly as `strtotime()` function).
Finally it'll require both `$date_value` and `$date_param` to be valid and will do the right comparison between them.