Skip to content

Commit

Permalink
Merge branch 'main' into gem_packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
bshand authored Jan 3, 2025
2 parents 2a8131c + b1baebb commit bef06ff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## [Unreleased]
## Fixed
* Exclude unneeded files from gem package
* 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

0 comments on commit bef06ff

Please sign in to comment.