Usage

{% extends "site_base.html" %}

{% load i18n %}
{% load pinax_calendars_tags %}

{% block messages %}{% endblock %}

{% block body %}
<section class="fragment-container">
    <h1>Pinax Calendars Template Tags</h1>

    <h2><div class="variation">Calendar</div><code>calendar.html</code></h2>
    <div class="calendars-fragment-container">
        {% calendar events the_date %}
    </div>
</section>
{% endblock %}

pinax/calendars/calendar.html

{% load i18n %}

<div class="calendar">
  <div class="calendar-heading">
    <h3 class="calendar-title">{{ title }}</h3>

    <div class="calendar-nav">
      {% if prev %}
        <a href="{{ prev }}">{% trans "Previous month" %}</a>
      {% endif %}

      <span class="calendar-date">{{ calendar_date|date:'m.Y' }}</span>

      {% if next %}
        <a href="{{ next }}">{% trans "Next month" %}</a>
      {% endif %}
    </div>
  </div>

  <div class="calendar-body">
    <table class="calendar-table">
      {% for row in grid %}
      <tr>
        {% for day in row %}
          {% if not day %}
            <td class="day noday"></td>
          {% else %}
            {% with day_day=day.0 day_events=day.1 link=day.2 is_today=day.3 %}
            <td class="day {% if day.1 %}day-has-events{% else %}day-no-events{% endif %}">
              {% if link %}
                <a href="{{ link }}" class="day-number">{{ day_day }}</a>
              {% else %}
                <span class="day-number">{{ day_day }}</span>
              {% endif %}
              {% if day_events %}
                <div class="day-event-list">
                  {% for event in day_events %}
                    <div class="day-event">
                      {{ event }}
                    </div>
                  {% endfor %}
                </div>
              {% endif %}
            </td>
            {% endwith %}
          {% endif %}
        {% endfor %}
      </tr>
      {% endfor %}
    </table>
  </div>
</div>