mirror of
https://github.com/Hestia-Homes/survey-extraction.git
synced 2026-07-12 13:29:08 +00:00
week commencing worked
This commit is contained in:
parent
944e5ece1d
commit
2fe9cf3d00
1 changed files with 11 additions and 1 deletions
|
|
@ -9,7 +9,17 @@ from functools import wraps
|
||||||
import re
|
import re
|
||||||
from etl.validator.validator import DomnaSharePointValidator
|
from etl.validator.validator import DomnaSharePointValidator
|
||||||
|
|
||||||
WEEK_COMMENCING = os.getenv("WEEK_COMMENCING", "W.C. 10.03.2025")
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
|
def previous_monday(date):
|
||||||
|
# If it's Monday, return the same date
|
||||||
|
if date.weekday() == 0:
|
||||||
|
return date.strftime("%d%m%y")
|
||||||
|
# Otherwise, find the previous Monday
|
||||||
|
previous_monday = date - timedelta(days=date.weekday())
|
||||||
|
return f"W.C. {previous_monday.strftime('%d.%m.%Y')}"
|
||||||
|
|
||||||
|
WEEK_COMMENCING = os.getenv("WEEK_COMMENCING", previous_monday())
|
||||||
|
|
||||||
class SharePointInstaller(Enum):
|
class SharePointInstaller(Enum):
|
||||||
SOUTH_COAST_INSULATION = os.getenv("SOUTH_COAST_INSULATION_SERVICE_SHAREPOINT_ID", None)
|
SOUTH_COAST_INSULATION = os.getenv("SOUTH_COAST_INSULATION_SERVICE_SHAREPOINT_ID", None)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue