Commit a5cb51a0 authored by Yusei Tahara's avatar Yusei Tahara

Result for August and September was wrong.

Hardcoding numbers is more simple and reliable.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37031 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7a994b1a
......@@ -480,18 +480,25 @@ def createDateTimeFromMillis(millis):
def getNumberOfDayInMonth(date):
month = date.month()
if month < 10 and month != 2:
if month % 2 == 0:
return 30
return 31
elif month >=10 and month != 2:
if month % 2 == 0:
return 31
return 30
else:
mapping = {
1:31,
3:31,
4:30,
5:31,
6:30,
7:31,
8:31,
9:30,
10:31,
11:30,
12:31
}
if month == 2:
if date.isLeapYear():
return 29
return 28
else:
return mapping[month]
def atTheEndOfPeriod(date, period):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment