Use date range for mock data instead of current year only
This commit is contained in:
parent
84bfdc819c
commit
3cd2644a88
@ -296,10 +296,13 @@ class MockReportingProvider(ReportingInterface):
|
|||||||
else:
|
else:
|
||||||
budget_months = {}
|
budget_months = {}
|
||||||
|
|
||||||
this_year = pendulum.now().year
|
end = pendulum.now()
|
||||||
|
start = end.subtract(months=12)
|
||||||
|
period = pendulum.period(start, end)
|
||||||
|
|
||||||
all_months = OrderedDict()
|
all_months = OrderedDict()
|
||||||
for m in range(1, 13):
|
for t in period.range("months"):
|
||||||
month_str = "{month:02d}/{year}".format(month=m, year=this_year)
|
month_str = "{month:02d}/{year}".format(month=t.month, year=t.year)
|
||||||
all_months[month_str] = budget_months.get(month_str, None)
|
all_months[month_str] = budget_months.get(month_str, None)
|
||||||
|
|
||||||
return {"months": all_months}
|
return {"months": all_months}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user