prismicio-community / php-kit

Community maintained development kit for Prismic and the PHP language
https://prismic.io
Other
108 stars 82 forks source link

dateBefore predicate issue #136

Closed levimykel closed 1 year ago

levimykel commented 7 years ago

The dateBefore predicate sometimes gives incorrect results.

In my case I have a timestamp field with the following data: screen shot 2017-06-01 at 16 24 05

When I do a query using the following predicate Predicates::dateBefore( {path}, new DateTime('2017-01-03')) it does not return the document above, which I would expect it to.

The following will return the document correctly: Predicates::dateBefore( {path}, '2017-01-03')

Therefore, I suspect that the conversion to a Timestamp needs to be fixed to account for time zones.

I'm also assuming that this needs to be done as well for the dateAfter and dateBetween predicates.

c0nst4ntin commented 1 year ago

Since there has been no activity since 2017 I will proceed to close this Issue! If anybody runs into this problem again, please re-open or start a new issue.