Paginate based on date-based starting points I'm working on creating a simple calendar based on only native Craft fields. While coding this, I'm having a hard time getting the pagination to work properly.

The calendar currently lists all upcoming events this current month. Next/Previous should then paginate the calendar 1 full month forward/backward (not 1 month backwards from todays date, but all entries in the next/previous month).

According to Brandon, paginate.prevUrl/nextUrl won't map to specific date-based starting points. So, how do I tackle this problem then?

Here's my current code:

&lt;div class="row"&gt;
    &lt;div class="small-12 medium-12 large-12 columns"&gt;
        &lt;div class="widget_event single_widget box_shadow"&gt;
            &lt;h3&gt;Hva skjer i Filadelfia&lt;/h3&gt;

            {% set startDateTime = now|date_modify('0:00')|date('c') %}
            {% set endDateTime = now|date_modify('first day of next month 4:00')|date('c') %}

            {% set startDateParam = 'and, &gt;= ' ~ startDateTime ~ ', &lt; ' ~ endDateTime %}

            {% set events = craft.entries.section('calendar').limit('15').startDate(startDateParam).order('startDate asc') %}

{% for event in events %}
    &lt;div class="event_list"&gt;
        &lt;div class="single_event"&gt;

            &lt;div class="date_left"&gt;
                &lt;p class="date"&gt;{{ event.startDate | date("d") }}.&lt;/p&gt;
                &lt;p class="day"&gt;{{ event.startDate | date("M") }}&lt;/p&gt;
            &lt;/div&gt;

            &lt;div class="title_middle"&gt;
                &lt;p class="title"&gt;{{ event.title }}&lt;/p&gt;
                &lt;p class="desc"&gt;{{ event.body | hacksaw(words='75', allow='&lt;b&gt;&lt;strong&gt;&lt;i&gt;&lt;em&gt;') }}&lt;/p&gt;
            &lt;/div&gt;

            &lt;div class="time"&gt;{{ event.startDate | date("H:i") }}&lt;/div&gt;

        &lt;/div&gt;
    &lt;/div&gt;
{% endfor %}


{% paginate craft.entries.section('calendar').limit(15) as pageEvents %}
    {% for month, entries in pageEvents | group("postDate | date('F')") %}
        &lt;div class="event_nav text-center"&gt;
            &lt;span class="left left_arrow"&gt;{% if paginate.prevUrl %}&lt;a href="{{ paginate.prevUrl }}"&gt;Previous Month&lt;/a&gt;{% endif %}&lt;/span&gt;
            &lt;span class="right right_arrow"&gt;{% if paginate.nextUrl %}&lt;a href="{{ paginate.nextUrl }}"&gt;Next Month&lt;/a&gt;{% endif %}&lt;/span&gt;
        &lt;/div&gt;
    {% endfor %}
{% endpaginate %}

        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
Instead of using pagination you might want to look into setting up a dynamic route in the format "calendar/[year]/[month]". Adding 'year' and 'month' tags to your route will essentially pass those values as named variables to your template, which you can use to retrieve and display entries, as well as generate navigation to next/previous month's events. If you want the uri '/calendar' (without the 'year/month' uri segments) to link to the current months events you can test for the existence of the 'year' and 'month' variables, and if not defined, set the start month to the first day of the current month.

{% if year is defined and month is defined %}
    {% set startMonth = year ~ '-' ~ month ~ '-' ~ 1 %}
{% else %}
    {% set startMonth = now|date_modify("first day of this month") %}
{% endif %}
{% set nextMonth = startMonth|date_modify('+1 month')) %}
{% set previousMonth = startMonth|date_modify('-1 month')) %}

{% set entries = craft.entries.section('calendar').postDate('and', '&gt;= ' ~ startMonth, '&lt; ' ~ nextMonth %}

{% for entry in entries %}
    {{ entry.title }}
    ...
{% endfor %}

&lt;div class="pagination"&gt;
    &lt;a href="{{ 'events/' ~ nextMonth|date("Y/n") }}"&gt;next month&lt;/a&gt;
    &lt;a href="{{ 'events/' ~ previousMonth|date("Y/n") }} "&gt;previous month&lt;/a&gt;
&lt;/div&gt;


If required, within any month you could also use a pagination tag if you needed to limit the number of events displayed on any one page to 15.

For additional examples see these answers, here and here.