bugfixing
This commit is contained in:
parent
65c1ac7b99
commit
1dc965c78a
@ -79,7 +79,7 @@ def load_latest_json(directory: str, find=True):
|
|||||||
print(f"Error loading JSON file: {e}")
|
print(f"Error loading JSON file: {e}")
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
'''
|
||||||
def get_last_completed_quarter():
|
def get_last_completed_quarter():
|
||||||
today = datetime.today()
|
today = datetime.today()
|
||||||
year = today.year
|
year = today.year
|
||||||
@ -93,3 +93,19 @@ def get_last_completed_quarter():
|
|||||||
return 4, year - 1
|
return 4, year - 1
|
||||||
else:
|
else:
|
||||||
return current_quarter - 1, year
|
return current_quarter - 1, year
|
||||||
|
'''
|
||||||
|
|
||||||
|
def get_last_completed_quarter():
|
||||||
|
today = datetime.today()
|
||||||
|
year = today.year
|
||||||
|
month = today.month
|
||||||
|
# Calculate the current quarter (1 to 4)
|
||||||
|
current_quarter = (month - 1) // 3 + 1
|
||||||
|
|
||||||
|
# Determine the quarter that is two quarters ago.
|
||||||
|
target_quarter = current_quarter - 2
|
||||||
|
if target_quarter < 1:
|
||||||
|
target_quarter += 4
|
||||||
|
year -= 1
|
||||||
|
|
||||||
|
return target_quarter, year
|
||||||
Loading…
x
Reference in New Issue
Block a user