bornhack-website/src/utils/templatetags/dateutils.py

12 lines
289 B
Python
Raw Normal View History

from django import template
from django.utils.dateparse import parse_date
2019-06-16 12:32:24 +00:00
register = template.Library()
2019-06-16 12:32:24 +00:00
@register.simple_tag
def get_weekday(year, month, day):
2019-06-16 12:32:24 +00:00
return parse_date(
"%(year)s-%(month)s-%(day)s" % {"year": year, "month": month, "day": day}
).strftime("%A")