def formatday(self, day, weekday):
super(EventCalendar, self).formatday(day, weekday)<EOL>now = get_now()<EOL>self.day = day<EOL>out = '<STR_LIT>'<EOL>if day == <NUM_LIT:0>:<EOL><INDENT>return '<STR_LIT>'  <EOL><DEDENT>elif now.month == self.mo and now.year == self.yr and day == now.day:<EOL><INDENT>if day in self.count:<EOL><INDENT>out = self.wkday_today + self.anch<EOL><DEDENT>else:<EOL><INDENT>return self.wkday_today + self.anch + self.end<EOL><DEDENT><DEDENT>elif day in self.count:<EOL><INDENT>out = self.wkday_not_today + self.anch<EOL><DEDENT>else:<EOL><INDENT>return self.wkday_not_today + self.anch + self.end<EOL><DEDENT>detail = "<STR_LIT>"<EOL>extras = ('<STR_LIT>'<EOL>'<STR_LIT>')<EOL>common = '<STR_LIT>'<EOL>for item in self.count[day]:<EOL><INDENT>self.pk = item[<NUM_LIT:1>]<EOL>self.title = item[<NUM_LIT:0>]<EOL>for event in self.events:<EOL><INDENT>if event.pk == self.pk:<EOL><INDENT>self.event = event<EOL>self.check_if_cancelled()<EOL>self.popover_helper()<EOL>bg, fnt = self.event.get_colors()<EOL><DEDENT><DEDENT>out += ('<STR_LIT>' + self.event_url + '<STR_LIT>' +<EOL>extras % (<EOL>self.title,<EOL>detail % (<EOL>self.when, self.where, self.desc, self.event_url<EOL>),<EOL>common % (bg, fnt)<EOL>) +<EOL>self.title2 + '<STR_LIT>')<EOL><DEDENT>return out + self.end<EOL>
Return a day as a table cell.