fix the monday

This commit is contained in:
Jun-te Kim 2025-06-17 08:52:38 +00:00
parent 28a2468cf8
commit b45cb03356

View file

@ -11,12 +11,12 @@ from etl.validator.validator import DomnaSharePointValidator
from datetime import datetime, timedelta
def this_weeks_monday():
def previous_monday():
today = datetime.today()
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", this_weeks_monday())
WEEK_COMMENCING = os.getenv("WEEK_COMMENCING", previous_monday())
class SharePointInstaller(Enum):
# https//{tenant}.sharepoint.com/sites/{site}/_api/site/id