File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 22
33
44import setuptools
5- VERSION = "1.2.9 "
5+ VERSION = "1.2.10 "
66setuptools .setup (
77 name = 'Classeviva.py' ,
88 packages = [
Original file line number Diff line number Diff line change @@ -24,7 +24,11 @@ def valida_date(*date_: str) -> None:
2424
2525
2626def anno () -> int :
27- return datetime .now ().year
27+ # Return the academic-year start year:
28+ # if current month >= September, the academic year starts this calendar year,
29+ # otherwise it started the previous calendar year.
30+ now = datetime .now ()
31+ return now .year if now .month >= 9 else now .year - 1
2832
2933
3034def data_inizio_anno () -> str :
@@ -37,6 +41,7 @@ def data_fine_anno() -> str:
3741
3842def data_fine_anno_o_oggi () -> str :
3943 # Restituisce la data di fine anno scolastico o quella del giorno corrente
40- if (datetime .now () < datetime (anno (), 6 , 30 )):
41- return f"{ anno ()} { datetime .now ().strftime ('%m%d' )} "
44+ end_of_school = datetime (anno ()+ 1 , 6 , 30 )
45+ if datetime .now () <= end_of_school :
46+ return datetime .now ().strftime ('%Y%m%d' )
4247 return data_fine_anno ()
You can’t perform that action at this time.
0 commit comments