Commits

Yuji Hanamura committed aaf7f44

Add getweeknum function argument types that are supported.

Comments (0)

Files changed (1)

 
     if not day:
         day = datetime.date.today()
+    elif isinstance(day, (tuple, list)):
+        day = datetime.date(int(day[0]), int(day[1]), int(day[2]))
+    elif isinstance(day, dict):
+        day = datetime.date(int(day['year']), int(day['month']), int(day['day']))
+    elif not isinstance(day, datetime.date):
+        day = datetime.date(int(day.year), int(day.month), int(day.year))
 
     return day.isocalendar()[1]