holidays / holidays

A collection of Ruby methods to deal with statutory and other holidays. You deserve a holiday!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GB Substitute Days over Christmas and New Year

ojsdude opened this issue · comments

in the UK; if Christmas (and boxing day) is on the weekend; there is a substitute bank holiday on the next day(s) e.g.
image
AND
image

The same goes for new year:
image

This is going to happen again this coming year:
image
The Tuesday is for Christmas as Monday is Boxing day.
image
The Monday is for the new years day the day before.

If these could be added it would be much appreciated as it will allow us to keep using this fantastic little gem

It looks like this is already supported/working in this gem:

irb(main):009:0> require 'holidays/core_extensions/date'
irb(main):010:1* class Date
irb(main):011:1*   include Holidays::CoreExtensions::Date
irb(main):012:0> end
=> Date
irb(main):013:0> Date.parse("2022-12-27").holiday?
=> true
irb(main):014:0> Date.parse("2023-01-02").holiday?
=> true

irb(main):015:0> Holidays.on("2022-12-27", :gb_eng, :observed)
=> [{:date=>Tue, 27 Dec 2022, :name=>"Boxing Day", :regions=>[:gb, :hk, :nz, :ng]}]

What are you seeing?