fix the monday

This commit is contained in:
Jun-te Kim 2025-06-17 08:50:48 +00:00
parent c40c991320
commit 28a2468cf8

View file

@ -11,13 +11,12 @@ from etl.validator.validator import DomnaSharePointValidator
from datetime import datetime, timedelta
def previous_monday():
def this_weeks_monday():
today = datetime.today()
last_monday = today - timedelta(days=today.weekday() + 7) # Go back to last week's Monday
# return f"W.C. 31.09.2000"
return f"W.C. {last_monday.strftime('%d.%m.%Y')}"
monday = today - timedelta(days=today.weekday()) # weekday() = 0 for Monday
return f"W.C. {monday.strftime('%d.%m.%Y')}"
WEEK_COMMENCING = os.getenv("WEEK_COMMENCING", previous_monday())
WEEK_COMMENCING = os.getenv("WEEK_COMMENCING", this_weeks_monday())
class SharePointInstaller(Enum):
# https//{tenant}.sharepoint.com/sites/{site}/_api/site/id