Mercurial > getan
changeset 568:e7b36e596751 tip
Last week's year is not necessarily today's year
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Mon, 03 Jan 2022 11:37:31 +0100 |
parents | 1d4c20db7eac |
children | |
files | scripts/getan-report |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/getan-report Tue Jun 01 16:07:01 2021 +0200 +++ b/scripts/getan-report Mon Jan 03 11:37:31 2022 +0100 @@ -47,8 +47,9 @@ args = parser.parse_args() if args.lastweek: - week = (datetime.now() - timedelta(7)).isocalendar()[1] - year = int(date.today().strftime("%Y")) + last_week = (datetime.now() - timedelta(7)).isocalendar() + week = last_week[1] + year = last_week[0] else: year = args.year week = args.week