Browse Source

Take into account all shifts 5 days before and 30 days after today's date

master
Raphael Roberts 5 years ago
parent
commit
66c262f846
  1. 7
      panera_shifts_gcal_backend/__init__.py

7
panera_shifts_gcal_backend/__init__.py

@ -17,11 +17,8 @@ def input_all_shifts_for_month():
# get latest inputted date; only show shifts past that date # get latest inputted date; only show shifts past that date
calendar = init_calendar() calendar = init_calendar()
today = datetime.date.today() today = datetime.date.today()
max_day = cal_module.monthrange(today.year, today.month)
start = datetime.date(today.year, today.month, 1)
end = datetime.date(today.year, today.month, max_day[1]) + datetime.timedelta(
days=1
)
start = today - datetime.timedelta(days=5)
end = start + datetime.timedelta(days=30)
start_dt = datetime.datetime.combine( start_dt = datetime.datetime.combine(
start, datetime.time(0, 0, 0, 0), datetime.timezone.utc start, datetime.time(0, 0, 0, 0), datetime.timezone.utc

Loading…
Cancel
Save