Commit d0b0b39e authored by Yusei Tahara's avatar Yusei Tahara

Fixed a bug which causes infinite loop if periodicity steps over the summer...

Fixed a bug which causes infinite loop if periodicity steps over the summer time start date or end date(ex. 2008/10/27 00:00 CET). DateTime.strftime method does not work as we expected. We expect that DateTime('2008/10/27').strftime('%d') returns 27, but it returns 26 in reality. Because "2008/10/27 00:00 GMT+1" equal to "2008/10/26 23:00 GMT+2".


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25502 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f3bcdb39
......@@ -182,7 +182,7 @@ class PeriodicityMixin:
if not(validate_day and validate_week and validate_month):
# We have to reset hours and minutes in order to make sure
# we will start at the beginning of the next day
next_start_date = DateTime(next_start_date.strftime('%Y/%m/%d') + ' 00:00:00 %s' % next_start_date.timezone())
next_start_date = DateTime(next_start_date.Date() + ' 00:00:00 %s' % next_start_date.timezone())
next_start_date = addToDate(next_start_date, day=1)
else:
# Everything is right, but the date is still not bigger
......
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