Correct date return month_start, month_end (#107)

Changes solve the problem of the incorrect date to "def current_month()". The error occured due to incorrect date format month_start.
pull/119/head
Alex 2017-12-05 00:00:25 +10:00 zatwierdzone przez James Ramm
rodzic f6f6da006a
commit 1881e4b9ed
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -11,8 +11,8 @@ from longclaw.longclaworders.models import Order, OrderItem
def current_month():
now = datetime.now()
n_days = calendar.monthrange(now.year, now.month)[1]
month_start = datetime.strptime('1{}{}'.format(now.month, now.year), '%d%m%Y')
month_end = datetime.strptime('{}{}{}'.format(n_days, now.month, now.year), '%d%m%Y')
month_start = datetime.strptime('{}{}{}'.format(now.year, now.month, 1), '%Y%m%d')
month_end = datetime.strptime('{}{}{}'.format(now.year,now.month, n_days), '%Y%m%d')
return month_start, month_end