Skip to content

Instantly share code, notes, and snippets.

@erwan
Last active August 29, 2015 14:07
Show Gist options
  • Save erwan/2bdf83055d57f35d5d85 to your computer and use it in GitHub Desktop.
Save erwan/2bdf83055d57f35d5d85 to your computer and use it in GitHub Desktop.
Prismic.Api('https://lesbonneschoses.prismic.io/api', function(err, Api) {
Api.form('everything').ref(Api.master()).query(
Predicates.at("document.type", "blog-post"),
Predicates.dateAfter("my.blog-post.date", new Date(2014, 6, 1))
).submit(function(err, response) {
// All documents of type "product", updated after June 1st, 2014
});
});
@grossbart
Copy link

Just a tiny little nitpickery: the Date object created here is in July, not June, due to the weird Date constructor whose month indices are zero-based (i.e. January is month 0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment