Remove Lee-Jackson Day - generated definitions (#540)

Followup to 7f4b174aa9

Also updates README with proper command to generate holiday definitions
This commit is contained in:
Joshua Rosenfeld 2024-02-06 12:51:31 -05:00 committed by GitHub
parent 7f4b174aa9
commit bfd7f63b1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 5 additions and 29 deletions

View File

@ -27,7 +27,7 @@ Generate updated holidays as follows.
cd vendor/holidays
# Generate holiday definitions
bin/rails generate:definitions
rake generate:definitions
```
Install the plugin and switch to the discourse root(not the plugin directory).

View File

@ -23,7 +23,7 @@ module Holidays
6 => [{:mday => 20, :name => "Día de la Bandera", :regions => [:ar]}],
7 => [{:mday => 8, :name => "Feriado puente turístico", :regions => [:ar]},
{:mday => 9, :name => "Día de la Independencia", :regions => [:ar]}],
8 => [{:mday => 15, :name => "Paso a la Inmortalidad del General José de San Martín", :regions => [:ar]}],
8 => [{:mday => 17, :name => "Paso a la Inmortalidad del General José de San Martín", :regions => [:ar]}],
10 => [{:mday => 12, :name => "Día del Respeto a la Diversidad Cultural", :regions => [:ar]}],
11 => [{:mday => 20, :name => "Día de la Soberanía Nacional", :regions => [:ar]}],
12 => [{:mday => 8, :name => "Inmaculada Concepción de María", :regions => [:ar]},

View File

@ -31,7 +31,6 @@ module Holidays
{:wday => 1, :week => 3, :name => "Civil Rights Day", :regions => [:us_ar]},
{:wday => 1, :week => 3, :name => "Martin Luther King, Jr. Day", :regions => [:us]},
{:function => "us_inauguration_day(year)", :function_arguments => [:year], :name => "Inauguration Day", :regions => [:us_tx, :us_dc, :us_la, :us_md, :us_va]},
{:function => "lee_jackson_day(year, month)", :function_arguments => [:year, :month], :name => "Lee-Jackson Day", :regions => [:us_va]},
{:mday => 19, :name => "Confederate Heroes Day", :regions => [:us_tx]}],
2 => [{:wday => 1, :week => 3, :year_ranges => { :from => 1990 },:name => "Family Day", :regions => [:ca_ab]},
{:wday => 1, :week => 3, :year_ranges => { :from => 2007 },:name => "Family Day", :regions => [:ca_sk]},
@ -196,13 +195,6 @@ state_holiday = Date.civil(year, month, 26)
state_holiday.downto(beginning_of_month).find {|date| date if date.wday == 1 }
},
"lee_jackson_day(year, month)" => Proc.new { |year, month|
day_of_holiday = Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, month, 3, 1)
beginning_of_month = Date.civil(year, month, 1)
king_day = Date.civil(year, month, day_of_holiday)
king_day.downto(beginning_of_month).find {|date| date if date.wday == 5 }
},
"election_day(year)" => Proc.new { |year|
Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 11, 1, 1) + 1
},

View File

@ -76,7 +76,7 @@ module Holidays
{:mday => 29, :name => "Segundo Día de la Independencia", :regions => [:pe]},
{:mday => 5, :name => "Día de la Independencia", :regions => [:ve]},
{:mday => 24, :name => "Natalicio de Simón Bolívar", :regions => [:ve]}],
8 => [{:mday => 15, :name => "Paso a la Inmortalidad del General José de San Martín", :regions => [:ar]},
8 => [{:mday => 17, :name => "Paso a la Inmortalidad del General José de San Martín", :regions => [:ar]},
{:mday => 15, :name => "Asunción de la Virgen", :regions => [:cl]},
{:mday => 7, :name => "Batalla de Boyacá", :regions => [:co]},
{:function => "assumption_of_mary(year)", :function_arguments => [:year], :name => "La Asunción de la Virgen", :regions => [:co]},

View File

@ -24,7 +24,6 @@ module Holidays
{:wday => 1, :week => 3, :name => "Civil Rights Day", :regions => [:us_ar]},
{:wday => 1, :week => 3, :name => "Martin Luther King, Jr. Day", :regions => [:us]},
{:function => "us_inauguration_day(year)", :function_arguments => [:year], :name => "Inauguration Day", :regions => [:us_tx, :us_dc, :us_la, :us_md, :us_va]},
{:function => "lee_jackson_day(year, month)", :function_arguments => [:year, :month], :name => "Lee-Jackson Day", :regions => [:us_va]},
{:mday => 19, :name => "Confederate Heroes Day", :regions => [:us_tx]}],
2 => [{:wday => 1, :week => 3, :name => "Presidents' Day", :regions => [:us]},
{:mday => 2, :type => :informal, :name => "Groundhog Day", :regions => [:us, :ca]},
@ -126,13 +125,6 @@ state_holiday = Date.civil(year, month, 26)
state_holiday.downto(beginning_of_month).find {|date| date if date.wday == 1 }
},
"lee_jackson_day(year, month)" => Proc.new { |year, month|
day_of_holiday = Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, month, 3, 1)
beginning_of_month = Date.civil(year, month, 1)
king_day = Date.civil(year, month, day_of_holiday)
king_day.downto(beginning_of_month).find {|date| date if date.wday == 5 }
},
"election_day(year)" => Proc.new { |year|
Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 11, 1, 1) + 1
},

View File

@ -37,7 +37,7 @@ class ArDefinitionTests < Test::Unit::TestCase # :nodoc:
assert_equal "Día de la Independencia", (Holidays.on(Date.civil(2016, 7, 9), [:ar], [:informal])[0] || {})[:name]
assert_equal "Paso a la Inmortalidad del General José de San Martín", (Holidays.on(Date.civil(2016, 8, 15), [:ar], [:informal])[0] || {})[:name]
assert_equal "Paso a la Inmortalidad del General José de San Martín", (Holidays.on(Date.civil(2016, 8, 17), [:ar], [:informal])[0] || {})[:name]
assert_equal "Día del Respeto a la Diversidad Cultural", (Holidays.on(Date.civil(2016, 10, 12), [:ar], [:informal])[0] || {})[:name]

View File

@ -334,10 +334,6 @@ assert_equal "Inauguration Day", (Holidays.on(Date.civil(2021, 1, 20), [:us_tx,
assert_nil (Holidays.on(Date.civil(2018, 1, 12), [:us])[0] || {})[:name]
assert_nil (Holidays.on(Date.civil(2019, 1, 18), [:us])[0] || {})[:name]
assert_equal "Lee-Jackson Day", (Holidays.on(Date.civil(2017, 1, 13), [:us_va])[0] || {})[:name]
assert_equal "Lee-Jackson Day", (Holidays.on(Date.civil(2018, 1, 12), [:us_va])[0] || {})[:name]
assert_equal "Lee-Jackson Day", (Holidays.on(Date.civil(2019, 1, 18), [:us_va])[0] || {})[:name]
assert_equal "Confederate Heroes Day", (Holidays.on(Date.civil(2017, 1, 19), [:us_tx])[0] || {})[:name]
assert_equal "Presidents' Day", (Holidays.on(Date.civil(2008, 2, 18), [:us])[0] || {})[:name]

View File

@ -37,7 +37,7 @@ class SouthamericaDefinitionTests < Test::Unit::TestCase # :nodoc:
assert_equal "Día de la Independencia", (Holidays.on(Date.civil(2016, 7, 9), [:ar], [:informal])[0] || {})[:name]
assert_equal "Paso a la Inmortalidad del General José de San Martín", (Holidays.on(Date.civil(2016, 8, 15), [:ar], [:informal])[0] || {})[:name]
assert_equal "Paso a la Inmortalidad del General José de San Martín", (Holidays.on(Date.civil(2016, 8, 17), [:ar], [:informal])[0] || {})[:name]
assert_equal "Día del Respeto a la Diversidad Cultural", (Holidays.on(Date.civil(2016, 10, 12), [:ar], [:informal])[0] || {})[:name]

View File

@ -73,10 +73,6 @@ assert_equal "Inauguration Day", (Holidays.on(Date.civil(2021, 1, 20), [:us_tx,
assert_nil (Holidays.on(Date.civil(2018, 1, 12), [:us])[0] || {})[:name]
assert_nil (Holidays.on(Date.civil(2019, 1, 18), [:us])[0] || {})[:name]
assert_equal "Lee-Jackson Day", (Holidays.on(Date.civil(2017, 1, 13), [:us_va])[0] || {})[:name]
assert_equal "Lee-Jackson Day", (Holidays.on(Date.civil(2018, 1, 12), [:us_va])[0] || {})[:name]
assert_equal "Lee-Jackson Day", (Holidays.on(Date.civil(2019, 1, 18), [:us_va])[0] || {})[:name]
assert_equal "Confederate Heroes Day", (Holidays.on(Date.civil(2017, 1, 19), [:us_tx])[0] || {})[:name]
assert_equal "Presidents' Day", (Holidays.on(Date.civil(2008, 2, 18), [:us])[0] || {})[:name]