Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [Unreleased]
* no unreleased changes
## Fixed
* Add 2027 bank holidays

## 5.10.4 / 2024-11-13
### Added
Expand Down
13 changes: 12 additions & 1 deletion lib/ndr_support/concerns/working_days.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
require 'active_support/time'

# This module contains logic for #working_days_until, #weekday?, and #public_holiday?.
module WorkingDays
module WorkingDays # rubocop:disable Metrics/ModuleLength
WEEK_DAYS = 1..5

# TODO: could we use https://github.com/alphagov/gds-api-adapters ?
# rubocop:disable Style/TrailingCommaInArrayLiteral
HOLIDAYS = [ # Sourced from https://www.gov.uk/bank-holidays
# 2012
'2012-01-02', # Monday - New Year's Day (substitute day)
Expand Down Expand Up @@ -145,7 +146,17 @@ module WorkingDays
'2026-08-31', # Monday - Summer bank holiday
'2026-12-25', # Friday - Christmas Day
'2026-12-28', # Monday - Boxing Day
# 2027
'2027-01-01', # Friday - New Year’s Day
'2027-03-26', # Friday - Good Friday
'2027-03-29', # Monday - Easter Monday
'2027-05-03', # Monday - Early May bank holiday
'2027-05-31', # Monday - Spring bank holiday
'2027-08-30', # Monday - Summer bank holiday
'2027-12-27', # Monday - Christmas Day
'2027-12-28', # Tuesday - Boxing Day
].map { |str| Date.parse(str) }
# rubocop:enable Style/TrailingCommaInArrayLiteral

def self.check_lookup
return true if HOLIDAYS.max >= 1.year.from_now
Expand Down
Loading