def month_statistics(target_date):
""" Alias of daterange_statistics() for a month targeted. """
start_of_month = timezone.datetime(year=target_date.year, month=target_date.month, day=1)
end_of_month = timezone.datetime.combine(start_of_month + relativedelta(months=1), time.min)
return range_statistics(start=start_of_month, end=end_of_month)
评论列表
文章目录