generated from hjess/PythonTemplateProject
[main] sync
All checks were successful
Build, Push, and Deploy to Nomad / docker-nomad (push) Successful in 1m1s
All checks were successful
Build, Push, and Deploy to Nomad / docker-nomad (push) Successful in 1m1s
This commit is contained in:
@@ -2,12 +2,12 @@ import calendar
|
||||
from datetime import date, timedelta
|
||||
|
||||
def skriv_datoer_med_formattering(år):
|
||||
start_dato = date(år, 1, 1)
|
||||
start_dato = date(år, 1, 1+10)
|
||||
slut_dato = date(år, 12, 29)
|
||||
dags_differens = timedelta(days=1)
|
||||
|
||||
print(f"Datoer for året {år}:\n")
|
||||
|
||||
resultat = []
|
||||
nuværende_dato = start_dato
|
||||
while nuværende_dato <= slut_dato:
|
||||
ugenummer = nuværende_dato.isocalendar()[1]
|
||||
@@ -17,14 +17,16 @@ def skriv_datoer_med_formattering(år):
|
||||
# Tabuler outputtet længere ind
|
||||
if ugedag == "Friday":
|
||||
print(f"{nuværende_dato.strftime('%Y-%m-%d')} Til Porto fra København")
|
||||
resultat.append({'date': nuværende_dato.strftime('%Y-%m-%d'), 'orgin': 'CPH', 'dest': 'LIS','uge':ugenummer, 'month':nuværende_dato.month})
|
||||
|
||||
if ugedag == "Wednesday":
|
||||
print(f"{nuværende_dato.strftime('%Y-%m-%d')} Til København fra Porto")
|
||||
resultat.append( { 'date': nuværende_dato.strftime( '%Y-%m-%d' ), 'orgin': 'LIS', 'dest': 'CPH','uge':ugenummer,'month':nuværende_dato.month} )
|
||||
|
||||
|
||||
# else:
|
||||
# print(f"{nuværende_dato.strftime('%Y-%m-%d')} ({ugedag})")
|
||||
|
||||
nuværende_dato += dags_differens
|
||||
|
||||
print(resultat)
|
||||
# Kald funktionen med det ønskede år
|
||||
skriv_datoer_med_formattering(2025)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user