This commit is contained in:
wea_ondara
2020-01-23 22:40:28 +01:00
parent 8877747692
commit 69221ac8b3
6 changed files with 78 additions and 63 deletions

View File

@@ -34,7 +34,7 @@ def calc_intervals(posts, months=3):
intervals = []
while cdate < lastpost:
nextmon = cdate.month + months
nextquarter = cdate.replace(month=nextmon if nextmon <=12 else nextmon-12, year=cdate.year + (0 if nextmon <= 12 else 1))
nextquarter = cdate.replace(month=nextmon if nextmon <= 12 else nextmon - 12, year=cdate.year + (0 if nextmon <= 12 else 1))
print("adding interval: " + cdate.strftime("%d-%m-%Y") + " - " + nextquarter.strftime("%d-%m-%Y"))
intervals.append((cdate, nextquarter))
cdate = nextquarter