The value stored in 'last' was being over-written.
This could lead to the end condition failing sometimes.
'last' is the last value added. we stop when that exceeds the end point.
'next' is the next value to add.
def make_dates(start, rr):
ret = []
last = start
+ next = last
s = date_seq(start, rr.interval, rr.step)
while (rr.count != None and len(ret) < rr.count) or (rr.end != None and last.before(rr.end)):
- n1 = [ copy.copy(last) ]
+ n1 = [ copy.copy(next) ]
for bn in byorder:
if bn not in rr.bylist:
continue
if n1:
last = n1[-1]
ret.extend(n1)
- last, valid = s.next()
+ next, valid = s.next()
while not valid and 'BYDAY' not in rr.bylist and 'BYMONTHDAY' not in rr.bylist:
- last, valid = s.next()
+ next, valid = s.next()
if rr.count:
ret = ret[:rr.count]
if rr.end: