Commit d63064ef authored by Thomas Lotze's avatar Thomas Lotze

add filter for month to report

parent 2f79c5f6
......@@ -14,8 +14,12 @@ import click
help='Access token',
prompt='Access token',
)
def cli(url, token):
entries = fetch(url, token)
@click.option(
'--month',
help='Filter for month (yyyy-mm)',
)
def cli(url, token, month):
entries = fetch(url, token, month)
report(entries)
......
......@@ -23,7 +23,7 @@ def parse_time(time_str):
return float(value_str) * unit
def fetch(url, token):
def fetch(url, token, month):
"""Yield all relevant time tracking entries, in no particular order.
"""
......@@ -59,6 +59,9 @@ def fetch(url, token):
if _ != sep:
continue
if month and not date.startswith(month):
continue
seconds = parse_action(action)
entries[note.author['username'], date] += seconds
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment