aboutsummaryrefslogtreecommitdiff
path: root/utils.py
blob: 5cc664848db47ef3a5ae6bd7109cb7fe70f9f45e (plain)
1
2
3
4
5
6
7
8
9
10
from django.utils import timezone

import datetime

def get_week(year, week):
    start = timezone.make_aware(datetime.datetime.strptime(
        "{0}-W{1:02d}-1".format(year, week), "%Y-W%W-%w"))
    end = start + datetime.timedelta(weeks=1)

    return start, end