Get current monh or year by default

This commit is contained in:
spla 2022-08-19 14:30:39 +02:00
pare c33033112c
commit e7ea255942

Veure arxiu

@ -175,6 +175,8 @@ class BillShow:
show_option = '' show_option = ''
now = datetime.now(tz)
try: try:
show_option = int(input('\nEnter your choice: ')) show_option = int(input('\nEnter your choice: '))
@ -186,13 +188,13 @@ class BillShow:
if show_option == 1: if show_option == 1:
self.option = 1 self.option = 1
self.criteria = input('Month (current year)? ') self.criteria = input('Month (enter = current month)? ') or str(now.month)
break break
elif show_option == 2: elif show_option == 2:
self.option = 2 self.option = 2
self.criteria = input('Year ? ') self.criteria = input('Year (enter = current year)? ') or str(now.year)
break break
elif show_option == 3: elif show_option == 3:
@ -291,6 +293,8 @@ class DonationShow:
show_option = '' show_option = ''
now = datetime.now(tz)
try: try:
show_option = int(input('\nEnter your choice: ')) show_option = int(input('\nEnter your choice: '))
@ -302,13 +306,13 @@ class DonationShow:
if show_option == 1: if show_option == 1:
self.option = 1 self.option = 1
self.criteria = input('Month (current year)? ') self.criteria = input('Month (enter = current month)? ') or str(now.month)
break break
elif show_option == 2: elif show_option == 2:
self.option = 2 self.option = 2
self.criteria = input('Year ? ') self.criteria = input('Year (enter = current year)? ') or str(now.year)
break break
elif show_option == 3: elif show_option == 3: