Skip to content

Instantly share code, notes, and snippets.

@AugustMiller
Created April 24, 2016 23:36
Show Gist options
  • Save AugustMiller/1706dd5d6fc5f36cd99723604d08b1cc to your computer and use it in GitHub Desktop.
Save AugustMiller/1706dd5d6fc5f36cd99723604d08b1cc to your computer and use it in GitHub Desktop.
Fetch entries with a custom date field set between two other dates
{% set entriesWithDateInRange = craft.entries({
section: 'section',
type: 'type',
order: 'customDate asc',
customDate: ['and', '>= ' ~ now, '<= ' ~ (now.year + 1)]
}) %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment