add 2018 and 2019 bank holidays

also refactor to use iso timestamps
This commit is contained in:
Leo Hemsted
2018-01-16 12:46:46 +00:00
parent 4aa37add5a
commit f297beb9bc

View File

@@ -191,25 +191,40 @@ def is_weekend(time):
def is_bank_holiday(time): def is_bank_holiday(time):
return time.strftime('%d/%m/%Y') in { return time.strftime('%Y-%m-%d') in {
# taken from # taken from https://www.gov.uk/bank-holidays.json
# https://github.com/alphagov/calendars/blob/7f6512b0a95d77aa22accef105860074c19f1ec0/lib/data/bank-holidays.json "2016-01-01",
"01/01/2016", "2016-03-25",
"25/03/2016", "2016-03-28",
"28/03/2016", "2016-05-02",
"02/05/2016", "2016-05-30",
"30/05/2016", "2016-08-29",
"29/08/2016", "2016-12-26",
"26/12/2016", "2016-12-27",
"27/12/2016", "2017-01-02",
"02/01/2017", "2017-04-14",
"14/04/2017", "2017-04-17",
"17/04/2017", "2017-05-01",
"01/05/2017", "2017-05-29",
"29/05/2017", "2017-08-28",
"28/08/2017", "2017-12-25",
"25/12/2017", "2017-12-26",
"26/12/2017", "2018-01-01",
"2018-03-30",
"2018-04-02",
"2018-05-07",
"2018-05-28",
"2018-08-27",
"2018-12-25",
"2018-12-26",
"2019-01-01",
"2019-04-19",
"2019-04-22",
"2019-05-06",
"2019-05-27",
"2019-08-26",
"2019-12-25",
"2019-12-26",
} }