Skip to content

Commit

Permalink
Closed on boxing day 2020
Browse files Browse the repository at this point in the history
This is a basic non-reusable piece of code:
1. Fix immediate issue
2. Easy to review/reason-with for current skeleton team
  • Loading branch information
said-moj committed Dec 22, 2020
1 parent 582f3e2 commit 06c9c32
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cla_common/call_centre_availability/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

SLOT_INTERVAL_MINS = 30

BOXING_DAY = datetime.date(year=2020, month=12, day=26)


def current_datetime():
# this function is to make unit testing simpler
Expand Down Expand Up @@ -94,6 +96,10 @@ def on_bank_holiday(time):
return day in bank_holidays()


def is_boxing_day_2020(dt):
return dt.date() == BOXING_DAY


def on_saturday(time):
return time.weekday() == 5

Expand Down Expand Up @@ -177,7 +183,7 @@ def date_matcher(key):
hours = lambda args: args and Hours(*args)

self.day_hours = [(date_matcher(key), hours(val)) for key, val in kwargs.iteritems()]

self.day_hours.append((is_boxing_day_2020, None))
self.day_hours.append((on_bank_holiday, hours(bank_holiday)))
self.day_hours.append((on_sunday, hours(sunday)))
self.day_hours.append((on_saturday, hours(saturday)))
Expand Down

0 comments on commit 06c9c32

Please sign in to comment.