diff 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
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
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)