Get current monh or year by default
This commit is contained in:
pare
c33033112c
commit
e7ea255942
S'han modificat 1 arxius amb 8 adicions i 4 eliminacions
12
budget.py
12
budget.py
|
@ -175,6 +175,8 @@ class BillShow:
|
|||
|
||||
show_option = ''
|
||||
|
||||
now = datetime.now(tz)
|
||||
|
||||
try:
|
||||
|
||||
show_option = int(input('\nEnter your choice: '))
|
||||
|
@ -186,13 +188,13 @@ class BillShow:
|
|||
if show_option == 1:
|
||||
|
||||
self.option = 1
|
||||
self.criteria = input('Month (current year)? ')
|
||||
self.criteria = input('Month (enter = current month)? ') or str(now.month)
|
||||
break
|
||||
|
||||
elif show_option == 2:
|
||||
|
||||
self.option = 2
|
||||
self.criteria = input('Year ? ')
|
||||
self.criteria = input('Year (enter = current year)? ') or str(now.year)
|
||||
break
|
||||
|
||||
elif show_option == 3:
|
||||
|
@ -291,6 +293,8 @@ class DonationShow:
|
|||
|
||||
show_option = ''
|
||||
|
||||
now = datetime.now(tz)
|
||||
|
||||
try:
|
||||
|
||||
show_option = int(input('\nEnter your choice: '))
|
||||
|
@ -302,13 +306,13 @@ class DonationShow:
|
|||
if show_option == 1:
|
||||
|
||||
self.option = 1
|
||||
self.criteria = input('Month (current year)? ')
|
||||
self.criteria = input('Month (enter = current month)? ') or str(now.month)
|
||||
break
|
||||
|
||||
elif show_option == 2:
|
||||
|
||||
self.option = 2
|
||||
self.criteria = input('Year ? ')
|
||||
self.criteria = input('Year (enter = current year)? ') or str(now.year)
|
||||
break
|
||||
|
||||
elif show_option == 3:
|
||||
|
|
Loading…
Referencia en una nova incidència