summaryrefslogtreecommitdiffstats
path: root/hyperkitty/lib
diff options
context:
space:
mode:
authorAslak Knutsen <aslak@redhat.com>2013-03-05 02:09:16 +0100
committerAslak Knutsen <aslak@redhat.com>2013-03-05 10:24:03 +0100
commit331ea452fa1186e096e3a905b2b729a599d07b42 (patch)
treea8359f49cb8df027656067d1b67b522b13a1871a /hyperkitty/lib
parent2df6a3857a9d75588a2242ae19d83b3355ad4bcc (diff)
downloadhyperkitty-331ea452fa1186e096e3a905b2b729a599d07b42.tar.gz
hyperkitty-331ea452fa1186e096e3a905b2b729a599d07b42.tar.xz
hyperkitty-331ea452fa1186e096e3a905b2b729a599d07b42.zip
Change Activity Graph from Protovis to d3 (#43)
Fixes failing javascipt in Opera and Chrome resulting in no graph and no other javascript features. Changed to precalculate all days in the begin_date...end_date date range before matching email counts to ensure we have data points for all days in the range.
Diffstat (limited to 'hyperkitty/lib')
-rw-r--r--hyperkitty/lib/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/hyperkitty/lib/__init__.py b/hyperkitty/lib/__init__.py
index 895e64e..3aa73fa 100644
--- a/hyperkitty/lib/__init__.py
+++ b/hyperkitty/lib/__init__.py
@@ -87,3 +87,8 @@ def get_display_dates(year, month, day):
end_date = begin_date + datetime.timedelta(days=1)
return begin_date, end_date
+
+
+def daterange(start_date, end_date):
+ for n in range(int((end_date - start_date).days)):
+ yield start_date + datetime.timedelta(n)