Commit 760ad2b2 authored by Simon Daron's avatar Simon Daron

Debug program

parent 24b9164e
......@@ -97,17 +97,14 @@ class ProgramView(TemplateView):
context = super(ProgramView, self).get_context_data(**kwargs)
context['sectionName'] = "emissions"
schedules = Schedule.objects.select_related().order_by('datetime')
week = int(week)
year = int(year)
days = []
for day in range(7):
days.append({'schedules': [x for x in schedules if x.is_on_weekday(day+1)],
'datetime': datetime(2007, 1, day+1)})
context['days'] = days
context['weekday'] = datetime.today().weekday()
context['week'] = week if week is not None else datetime.today().isocalendar()[1]-1
context['week'] = week if week is not None else datetime.today().isocalendar()[1]-1
context['year'] = year if year is not None else datetime.today().year
context['week'] = week = int(week) if week is not None else datetime.today().isocalendar()[1]-1
context['year'] = year = int(year) if year is not None else datetime.today().year
context['week_first_day'] = datetime.strptime(str(year)+' '+str(week)+' 1', '%Y %U %w')
context['week_last_day'] = context['week_first_day'] + timedelta(days=+6)
context['week_previous'] = context['week_first_day'] + timedelta(days=-7)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment