# Path: happenings/utils/common.py
# def inc_month(month, year):
# def _inc_day(year, month, day, net):
# def get_net_category_tag(req):
# def get_net(req):
# def get_category_tag(req):
# def get_qs(old_qs):
# def order_events(events, d=False):
# def get_next_and_prev(net):
# def _check_year(year, month, error, error_msg):
# def clean_year_month_day(year, month, day, net):
# def clean_year_month(year, month, month_orig):
# def check_weekday(year, month, day, reverse=False):


from calendar import LocaleHTMLCalendar, HTMLCalendar, month_name
from datetime import date
from django.conf import settings
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
from django.utils.dates import WEEKDAYS, WEEKDAYS_ABBR
from django.utils.html import mark_safe
from .common import get_now, get_next_and_prev
import sys
import six
    def __init__(self, *args):
        super(MiniEventCalendar, self).__init__(*args)
        # Change count from a defaultdict to a regular dict, so that when we
        # try and check if there are days in count, they won't be added if they
        # aren't there.
        self.count = dict(self.count)

    def popover_helper(self):
        num_events = len(self.count[self.day])
        titles = ''
        for item in self.count[self.day]:
            pk = item[1]
            for event in self.events:
                if event.pk == pk:
                    self.event = event
                    t = LEGACY_CALENDAR_TIME_FORMAT if event.l_start_date.minute else LEGACY_CALENDAR_HOUR_FORMAT
                    self.title = event.l_start_date.strftime(t).lstrip('0') + \
                        ' - ' + event.title
                    self.check_if_cancelled()
                    titles += "<li><a href=\'%s\'>%s</a></li>" % (
                        event.get_absolute_url(), self.title
                    )
        self.cal_event = '<div data-content="<ul>%s</ul>"\
            data-container="body"\
            data-toggle="popover" class="calendar-event">%s</div>' % (
            titles, num_events)

    def formatday(self, day, weekday):
        """Return a day as a table cell."""
        super(MiniEventCalendar, self).formatday(day, weekday)

# Path: happenings/utils/common.py
# def inc_month(month, year):
# def _inc_day(year, month, day, net):
# def get_net_category_tag(req):
# def get_net(req):
# def get_category_tag(req):
# def get_qs(old_qs):
# def order_events(events, d=False):
# def get_next_and_prev(net):
# def _check_year(year, month, error, error_msg):
# def clean_year_month_day(year, month, day, net):
# def clean_year_month(year, month, month_orig):
# def check_weekday(year, month, day, reverse=False):


# Path: happenings/utils/calendars.py
from calendar import LocaleHTMLCalendar, HTMLCalendar, month_name
from datetime import date
from django.conf import settings
from django.core.urlresolvers import reverse
from django.template.loader import render_to_string
from django.utils.dates import WEEKDAYS, WEEKDAYS_ABBR
from django.utils.html import mark_safe
from .common import get_now, get_next_and_prev
import sys
import six

    def __init__(self, *args):
        super(MiniEventCalendar, self).__init__(*args)
        # Change count from a defaultdict to a regular dict, so that when we
        # try and check if there are days in count, they won't be added if they
        # aren't there.
        self.count = dict(self.count)

    def popover_helper(self):
        num_events = len(self.count[self.day])
        titles = ''
        for item in self.count[self.day]:
            pk = item[1]
            for event in self.events:
                if event.pk == pk:
                    self.event = event
                    t = LEGACY_CALENDAR_TIME_FORMAT if event.l_start_date.minute else LEGACY_CALENDAR_HOUR_FORMAT
                    self.title = event.l_start_date.strftime(t).lstrip('0') + \
                        ' - ' + event.title
                    self.check_if_cancelled()
                    titles += "<li><a href=\'%s\'>%s</a></li>" % (
                        event.get_absolute_url(), self.title
                    )
        self.cal_event = '<div data-content="<ul>%s</ul>"\
            data-container="body"\
            data-toggle="popover" class="calendar-event">%s</div>' % (
            titles, num_events)

    def formatday(self, day, weekday):
        """Return a day as a table cell."""
        super(MiniEventCalendar, self).formatday(day, weekday)

        now = get_now()