Query entries based on date's year I'm trying to pull all events where the event's year from endDate matches the queried year (yearParam). When I have this, it's pulling in all events before the yearParam:

{% set pastEntries = craft.entries({endDate: '&lt;' ~ yearParam}).section('events').order('endDate desc') %}


However, what I'd really like is to get entries that match the yearParam (so if the yearParam is 2017, then any events from 2017 should be pulled in). 

Any and all help is greatly appreciated. Thanks!
Filtering entries by year with pagination example:

{% set query = craft.request.getQuery() %}
{% set selectedYear = query.year is defined ? query.year|abs : FALSE %}

{% paginate craft.entries({
   section: 'news',
   postDate: '&gt;=' ~ selectedYear,
   postDate: '&lt;' ~ (selectedYear + 1)
}).limit(12) as pageInfo, newsEntries %}