client.query([
Prismic.Predicates.month('my.blog_post.release_date', 'May'),
Prismic.Predicates.year('my.blog_post.release_date', 2016)
]).then(res => {
// res is the response object, res.results holds the documents
})
In order to implement an archive for my client's blog. I am finding success when I am using the Prismic.Predicates.month OR Prismic.Predicates.year.... but not when they are being used together to return a result. I am receiving the following error:
My code is as follows. Note that the variable 'year' is stored in my state from another listener, so it is not returning 'null', it is returning whatever date I select on my dropdown.
Welcome to the Prismic community, and thanks for reaching out to us.
I find in your code that you need to combine more than one predicates to refine your query. Put all your predicates into a comma-separated array like the following example: