Show More
@@ -28,7 +28,7 b'' | |||||
28 | import calendar |
|
28 | import calendar | |
29 | import logging |
|
29 | import logging | |
30 | from time import mktime |
|
30 | from time import mktime | |
31 | from datetime import datetime, timedelta |
|
31 | from datetime import datetime, timedelta, date | |
32 |
|
32 | |||
33 | from vcs.exceptions import ChangesetError |
|
33 | from vcs.exceptions import ChangesetError | |
34 |
|
34 | |||
@@ -105,15 +105,14 b' class SummaryController(BaseController):' | |||||
105 | except ChangesetError: |
|
105 | except ChangesetError: | |
106 | c.repo_branches[name] = EmptyChangeset(hash) |
|
106 | c.repo_branches[name] = EmptyChangeset(hash) | |
107 |
|
107 | |||
108 |
td = date |
|
108 | td = date.today() + timedelta(days=1) | |
109 | y, m, d = td.year, td.month, td.day |
|
109 | td_1m = td - timedelta(days=calendar.mdays[td.month]) | |
|
110 | td_1y = td - timedelta(days=365) | |||
110 |
|
111 | |||
111 | ts_min_y = mktime((y - 1, (td - timedelta(days=calendar.mdays[m])).month, |
|
112 | ts_min_m = mktime(td_1m.timetuple()) | |
112 | d, 0, 0, 0, 0, 0, 0,)) |
|
113 | ts_min_y = mktime(td_1y.timetuple()) | |
113 | ts_min_m = mktime((y, (td - timedelta(days=calendar.mdays[m])).month, |
|
114 | ts_max_y = mktime(td.timetuple()) | |
114 | d, 0, 0, 0, 0, 0, 0,)) |
|
|||
115 |
|
115 | |||
116 | ts_max_y = mktime((y, m, d, 0, 0, 0, 0, 0, 0,)) |
|
|||
117 | if c.repo_info.dbrepo.enable_statistics: |
|
116 | if c.repo_info.dbrepo.enable_statistics: | |
118 | c.no_data_msg = _('No data loaded yet') |
|
117 | c.no_data_msg = _('No data loaded yet') | |
119 | run_task(get_commits_stats, c.repo_info.name, ts_min_y, ts_max_y) |
|
118 | run_task(get_commits_stats, c.repo_info.name, ts_min_y, ts_max_y) |
General Comments 0
You need to be logged in to leave comments.
Login now