From f297beb9bc3d42cbf515c3f59a9aa893822c9b53 Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Tue, 16 Jan 2018 12:46:46 +0000 Subject: [PATCH] add 2018 and 2019 bank holidays also refactor to use iso timestamps --- app/main/views/feedback.py | 53 ++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/app/main/views/feedback.py b/app/main/views/feedback.py index 92c2ce479..69d40ffd6 100644 --- a/app/main/views/feedback.py +++ b/app/main/views/feedback.py @@ -191,25 +191,40 @@ def is_weekend(time): def is_bank_holiday(time): - return time.strftime('%d/%m/%Y') in { - # taken from - # https://github.com/alphagov/calendars/blob/7f6512b0a95d77aa22accef105860074c19f1ec0/lib/data/bank-holidays.json - "01/01/2016", - "25/03/2016", - "28/03/2016", - "02/05/2016", - "30/05/2016", - "29/08/2016", - "26/12/2016", - "27/12/2016", - "02/01/2017", - "14/04/2017", - "17/04/2017", - "01/05/2017", - "29/05/2017", - "28/08/2017", - "25/12/2017", - "26/12/2017", + return time.strftime('%Y-%m-%d') in { + # taken from https://www.gov.uk/bank-holidays.json + "2016-01-01", + "2016-03-25", + "2016-03-28", + "2016-05-02", + "2016-05-30", + "2016-08-29", + "2016-12-26", + "2016-12-27", + "2017-01-02", + "2017-04-14", + "2017-04-17", + "2017-05-01", + "2017-05-29", + "2017-08-28", + "2017-12-25", + "2017-12-26", + "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", }