aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Thompson <daniel.thompson@linaro.org>2018-10-10 16:08:39 +0100
committerDaniel Thompson <daniel.thompson@linaro.org>2018-10-10 16:08:39 +0100
commit70b75af61f7a6443ae9c2d47d8382ba4d7a89514 (patch)
tree526c18a52daf7016829e1c44c683899008884a58
parentc65771a967109ad3faf9bfa006a257b73a60f8ed (diff)
glance: chart: Improve collation by week
... because ISO week numbers are even harder to work with than the Gregorian calendar.
-rwxr-xr-xbin/glance7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/glance b/bin/glance
index a741601..a178a42 100755
--- a/bin/glance
+++ b/bin/glance
@@ -13,6 +13,7 @@ Prerequisites (ubuntu:16.04):
import argparse
import collections
+import datetime
from jira.client import JIRA
import json
import iso8601
@@ -393,7 +394,11 @@ def do_chart(issues, **args):
args['barchart'] = True
# Functions to parse worklog data
- collate_by_week = lambda w: w.date('started').strftime('%Y-%U')
+ def collate_by_week(w):
+ d = w.date('started')
+ while d.weekday() != 4:
+ d += datetime.timedelta(1)
+ return d.strftime('%Y-%m-%d')
collate_by_month = lambda w: w.date('started').strftime('%Y-%m')
collate_by_engineer = lambda w: w['author']['displayName']
collate_by_member = lambda w: report.issues[w['issue']].get_member()