fixed the date offset when building date tree
This commit is contained in:
parent
c92b673e39
commit
bed151eb70
7
decal
7
decal
|
@ -217,9 +217,9 @@ for cal in calendars:
|
||||||
events_fetched = cal.date_search(start,end)
|
events_fetched = cal.date_search(start,end)
|
||||||
for event in events_fetched:
|
for event in events_fetched:
|
||||||
event = event.vobject_instance.vevent.contents
|
event = event.vobject_instance.vevent.contents
|
||||||
curdate = event["dtstart"][0].value + datetime.timedelta(days=-1)
|
curdate = event["dtstart"][0].value
|
||||||
while curdate < event["dtend"][0].value:
|
enddate = event["dtend"][0].value
|
||||||
curdate += datetime.timedelta(days=1)
|
while curdate <= enddate:
|
||||||
curdindex = (curdate.year,curdate.month)
|
curdindex = (curdate.year,curdate.month)
|
||||||
if curdindex in events:
|
if curdindex in events:
|
||||||
if not curdate.day in events[curdindex]:
|
if not curdate.day in events[curdindex]:
|
||||||
|
@ -227,6 +227,7 @@ for cal in calendars:
|
||||||
events[curdindex][curdate.day].append(event)
|
events[curdindex][curdate.day].append(event)
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
curdate += datetime.timedelta(days=1)
|
||||||
# if you're reading the source code for this (oof), feel free to suggest improvements for this, or, well, anything above or below this comment (as long as it's not just "rewrite this entire thing in C++ for me because i think python bad", "idk how but optimize stuff kthx". just don't be a dick, ok? thanks).
|
# if you're reading the source code for this (oof), feel free to suggest improvements for this, or, well, anything above or below this comment (as long as it's not just "rewrite this entire thing in C++ for me because i think python bad", "idk how but optimize stuff kthx". just don't be a dick, ok? thanks).
|
||||||
|
|
||||||
# and now we're just generating calendar lines
|
# and now we're just generating calendar lines
|
||||||
|
|
Loading…
Reference in New Issue