diff options
author | Daniel Thompson <daniel.thompson@linaro.org> | 2018-10-10 16:08:39 +0100 |
---|---|---|
committer | Daniel Thompson <daniel.thompson@linaro.org> | 2018-10-10 16:08:39 +0100 |
commit | 70b75af61f7a6443ae9c2d47d8382ba4d7a89514 (patch) | |
tree | 526c18a52daf7016829e1c44c683899008884a58 | |
parent | c65771a967109ad3faf9bfa006a257b73a60f8ed (diff) |
glance: chart: Improve collation by week
... because ISO week numbers are even harder to work with than the
Gregorian calendar.
-rwxr-xr-x | bin/glance | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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() |