Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add ability for showing history of weeks and days

  • Loading branch information...
commit 6576938ce2056c9da9c2574a7ee7067e001af4f9 1 parent 737c59b
@acetous acetous authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 tracstats/web_ui.py
View
12 tracstats/web_ui.py
@@ -97,11 +97,23 @@ def process_request(self, req):
where.append("author = '%s'" % author)
if last:
m = re.match('(\d+)m', last)
+ w = re.match('(\d+)w', last)
+ d = re.match('(\d+)d', last)
if m is not None:
now = time.time()
months, = m.groups()
ago = (24 * 60 * 60 * 30 * int(months))
where.append('%s > %s' % (SECONDS, now - ago))
+ elif w is not None:
+ now = time.time()
+ weeks, = w.groups()
+ ago = (24 * 60 * 60 * 7 * int(weeks))
+ where.append('%s > %s' % (SECONDS, now - ago))
+ elif d is not None:
+ now = time.time()
+ days, = d.groups()
+ ago = (24 * 60 * 60 * int(days))
+ where.append('%s > %s' % (SECONDS, now - ago))
if where:
where = 'where ' + ' and '.join(where)
else:
Please sign in to comment.
Something went wrong with that request. Please try again.