Initial commit

This commit is contained in:
root
2026-07-18 16:04:40 +00:00
commit d96a087a16
6143 changed files with 827458 additions and 0 deletions

27
accounts/utils.py Normal file
View File

@@ -0,0 +1,27 @@
from datetime import timedelta
from django.utils import timezone
def get_shift_date_range(schedule="daily"):
now = timezone.now()
today_8am = now.replace(
hour=8,
minute=0,
second=0,
microsecond=0
)
if schedule.lower() == "daily":
start_date = today_8am - timedelta(days=1)
end_date = today_8am
else:
start_date = today_8am
end_date = today_8am + timedelta(days=1)
return start_date, end_date