Mercurial > getan
comparison scripts/getan-report @ 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 | d44ee9cd7261 |
children |
comparison
equal
deleted
inserted
replaced
567:1d4c20db7eac | 568:e7b36e596751 |
---|---|
45 parser.add_argument('--encoding', help='encoding of output') | 45 parser.add_argument('--encoding', help='encoding of output') |
46 | 46 |
47 args = parser.parse_args() | 47 args = parser.parse_args() |
48 | 48 |
49 if args.lastweek: | 49 if args.lastweek: |
50 week = (datetime.now() - timedelta(7)).isocalendar()[1] | 50 last_week = (datetime.now() - timedelta(7)).isocalendar() |
51 year = int(date.today().strftime("%Y")) | 51 week = last_week[1] |
52 year = last_week[0] | |
52 else: | 53 else: |
53 year = args.year | 54 year = args.year |
54 week = args.week | 55 week = args.week |
55 | 56 |
56 template_name = args.template or "wochenbericht" | 57 template_name = args.template or "wochenbericht" |