Setting first day on HTMLCalendar

I'd like to make Sunday the first day in my calendar, but I'm not sure how to. I know that calendar.setfirstweekday() is a method that can be used for calendars, but I don't know that it's available for HTMLCalendar.

utils.py

class Calendar(HTMLCalendar):
    def __init__(self, year=None, month=None, user=None):
        self.year = year    
        self.month = month
        self.user = user
        super(Calendar, self).__init__()

Views.py

class CalendarView(generic.ListView):
    model = Event
    template_name = 'accounts/calendar.html'
def get_context_data(self, **kwargs):
    context = super().get_context_data(**kwargs)        
    user = self.request.user

    cal = Calendar(d.year, d.month, user)

    html_cal = cal.formatmonth(withyear=True)

    context['calendar'] = mark_safe(html_cal)

    return context


#django #html

2 Likes5.55 GEEK