Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def formatyear(self, year):
self.year = year
return super(EventCalendar, self).formatyear(year)
def show_year(events, date, size="small"):
year_table = EventCalendar(events, size).formatyear(int(date))
return {'year_table':year_table }
def show_month(events, date, size="large"):
if date == '':
month_table = EventCalendar(events, size).formatmonth(datetime.now().year, datetime.now().month)
else:
month_table = EventCalendar(events, size).formatmonth(date.year, date.month)
return {'month_table':month_table, 'size':size }
def get_context_data(self, **kwargs):
context = super(EventListView, self).get_context_data(**kwargs)
context['month'] = EventCalendar(self.get_queryset()).formatmonth(datetime.now().year, datetime.now().month)
if self.calendar:
context['calendar'] = self.calendar
return context