2011-09-12 23:42:44 +02:00
|
|
|
# Poland holiday definitions for the Ruby Holiday gem.
|
|
|
|
#
|
|
|
|
# Updated: 2011-09-12.
|
|
|
|
# Source: http://pl.wikipedia.org/wiki/Dni_wolne_od_pracy_w_Polsce
|
|
|
|
---
|
|
|
|
months:
|
|
|
|
0:
|
|
|
|
- name: Tłusty Czwartek
|
|
|
|
regions: [pl]
|
|
|
|
function: easter(year)-52
|
|
|
|
type: informal
|
|
|
|
- name: Ostatki
|
|
|
|
regions: [pl]
|
|
|
|
function: easter(year)-47
|
|
|
|
type: informal
|
|
|
|
- name: Środa Popielcowa
|
|
|
|
regions: [pl]
|
|
|
|
function: easter(year)-46
|
|
|
|
type: informal
|
|
|
|
- name: Niedziela Palmowa
|
|
|
|
regions: [pl]
|
|
|
|
function: easter(year)-7
|
|
|
|
type: informal
|
|
|
|
- name: Wielki Czwartek
|
|
|
|
regions: [pl]
|
|
|
|
function: easter(year)-3
|
|
|
|
type: informal
|
|
|
|
- name: Wielki Piątek
|
|
|
|
regions: [pl]
|
|
|
|
function: easter(year)-2
|
|
|
|
type: informal
|
|
|
|
- name: Wielka Sobota
|
|
|
|
regions: [pl]
|
|
|
|
function: easter(year)-1
|
|
|
|
type: informal
|
|
|
|
- name: Niedziela Wielkanocna
|
|
|
|
regions: [pl]
|
|
|
|
function: easter(year)
|
|
|
|
- name: Poniedziałek Wielkanocny (Lany Poniedziałek)
|
|
|
|
regions: [pl]
|
|
|
|
function: easter(year)+1
|
|
|
|
- name: Zesłanie Ducha Świętego (Zielone Świątki)
|
|
|
|
regions: [pl]
|
|
|
|
function: easter(year)+49
|
|
|
|
- name: Uroczystość Najświętszego Ciała i Krwi Pańskiej (Boże Ciało)
|
|
|
|
regions: [pl]
|
|
|
|
function: easter(year)+60
|
|
|
|
1:
|
|
|
|
- name: Nowy Rok
|
|
|
|
regions: [pl]
|
|
|
|
mday: 1
|
|
|
|
- name: Objawienie Pańskie (święto Trzech Króli)
|
|
|
|
regions: [pl]
|
|
|
|
function: pl_trzech_kroli(year)
|
|
|
|
- name: Objawienie Pańskie (święto Trzech Króli)
|
|
|
|
regions: [pl]
|
|
|
|
function: pl_trzech_kroli_informal(year)
|
|
|
|
type: informal
|
|
|
|
- name: Dzień Babci
|
|
|
|
regions: [pl]
|
|
|
|
mday: 21
|
|
|
|
type: informal
|
|
|
|
- name: Dzień Dziadka
|
|
|
|
regions: [pl]
|
|
|
|
mday: 22
|
|
|
|
type: informal
|
|
|
|
2:
|
|
|
|
- name: Ofiarowanie Pańskie (Matki Boskiej Gromnicznej)
|
|
|
|
regions: [pl]
|
|
|
|
mday: 2
|
|
|
|
type: informal
|
|
|
|
- name: Dzień Zakochanych (Walentynki)
|
|
|
|
regions: [pl]
|
|
|
|
mday: 14
|
|
|
|
type: informal
|
|
|
|
3:
|
|
|
|
- name: Dzień Kobiet
|
|
|
|
regions: [pl]
|
|
|
|
mday: 8
|
|
|
|
type: informal
|
|
|
|
- name: Dzień Mężczyzn
|
|
|
|
regions: [pl]
|
|
|
|
mday: 10
|
|
|
|
type: informal
|
|
|
|
4:
|
|
|
|
- name: Prima Aprilis
|
|
|
|
regions: [pl]
|
|
|
|
mday: 1
|
|
|
|
type: informal
|
|
|
|
- name: Międzynarodowy Dzień Ziemi
|
|
|
|
regions: [pl]
|
|
|
|
mday: 22
|
|
|
|
type: informal
|
|
|
|
5:
|
|
|
|
- name: Święto Państwowe (Święto Pracy)
|
|
|
|
regions: [pl]
|
|
|
|
mday: 1
|
|
|
|
- name: Dzień Flagi Rzeczpospolitej Polskiej
|
|
|
|
regions: [pl]
|
|
|
|
mday: 2
|
|
|
|
type: informal
|
|
|
|
- name: Święto Narodowe Trzeciego Maja
|
|
|
|
regions: [pl]
|
|
|
|
mday: 3
|
|
|
|
6:
|
|
|
|
- name: Dzień Ojca
|
|
|
|
regions: [pl]
|
|
|
|
mday: 23
|
|
|
|
type: informal
|
|
|
|
8:
|
|
|
|
- name: Wniebowzięcie Najświętszej Maryi Panny
|
|
|
|
regions: [pl]
|
|
|
|
mday: 15
|
|
|
|
- name: Święto Wojska Polskiego
|
|
|
|
regions: [pl]
|
|
|
|
mday: 15
|
|
|
|
9:
|
|
|
|
- name: Dzień Chłopaka
|
|
|
|
regions: [pl]
|
|
|
|
mday: 30
|
|
|
|
type: informal
|
|
|
|
10:
|
|
|
|
- name: Dzień Nauczyciela (Dzień Edukacji Narodowej)
|
|
|
|
regions: [pl]
|
|
|
|
mday: 14
|
|
|
|
type: informal
|
|
|
|
11:
|
|
|
|
- name: Wszystkich Świętych
|
|
|
|
regions: [pl]
|
|
|
|
mday: 1
|
|
|
|
- name: Dzień Zaduszny
|
|
|
|
regions: [pl]
|
|
|
|
mday: 2
|
|
|
|
type: informal
|
|
|
|
- name: Narodowe Święto Niepodległości
|
|
|
|
regions: [pl]
|
|
|
|
mday: 11
|
|
|
|
- name: Andrzejki
|
|
|
|
regions: [pl]
|
|
|
|
mday: 29
|
|
|
|
type: informal
|
|
|
|
12:
|
|
|
|
- name: Barbórka (Dzień Górnika, Naftowca i Gazownika)
|
|
|
|
regions: [pl]
|
|
|
|
mday: 4
|
|
|
|
type: informal
|
|
|
|
- name: Mikołajki
|
|
|
|
regions: [pl]
|
|
|
|
mday: 6
|
|
|
|
type: informal
|
|
|
|
- name: Wigilia Bożego Narodzenia
|
|
|
|
regions: [pl]
|
|
|
|
mday: 24
|
|
|
|
type: informal
|
|
|
|
- name: pierwszy dzień Bożego Narodzenia
|
|
|
|
regions: [pl]
|
|
|
|
mday: 25
|
|
|
|
- name: drugi dzień Bożego Narodzenia
|
|
|
|
regions: [pl]
|
|
|
|
mday: 26
|
|
|
|
- name: Sylwester
|
|
|
|
regions: [pl]
|
|
|
|
mday: 31
|
|
|
|
type: informal
|
|
|
|
methods:
|
|
|
|
pl_trzech_kroli: |
|
2011-09-12 23:48:32 +02:00
|
|
|
# Poland: January 6 is holiday since 2011
|
2011-09-12 23:42:44 +02:00
|
|
|
def self.pl_trzech_kroli(year)
|
|
|
|
year >= 2011 ? 6 : nil
|
|
|
|
end
|
|
|
|
pl_trzech_kroli_informal: |
|
2011-09-12 23:48:32 +02:00
|
|
|
# Poland: January 6 wasn't holiday before 2011
|
2011-09-12 23:42:44 +02:00
|
|
|
def self.pl_trzech_kroli_informal(year)
|
|
|
|
year < 2011 ? 6 : nil
|
|
|
|
end
|
|
|
|
tests: |
|
|
|
|
{Date.civil(2011,1,1) => 'Nowy Rok',
|
|
|
|
Date.civil(2011,5,1) => 'Święto Państwowe (Święto Pracy)',
|
|
|
|
Date.civil(2011,5,3) => 'Święto Narodowe Trzeciego Maja',
|
|
|
|
Date.civil(2011,11,1) => 'Wszystkich Świętych',
|
|
|
|
Date.civil(2011,11,11) => 'Narodowe Święto Niepodległości',
|
|
|
|
Date.civil(2011,12,25) => 'pierwszy dzień Bożego Narodzenia',
|
|
|
|
Date.civil(2011,12,26) => 'drugi dzień Bożego Narodzenia'}.each do |date, name|
|
|
|
|
assert_equal name, (Holidays.on(date, :pl)[0] || {})[:name]
|
|
|
|
end
|
|
|
|
|
|
|
|
# informal
|
|
|
|
{Date.civil(2011,1,21) => 'Dzień Babci',
|
|
|
|
Date.civil(2011,1,22) => 'Dzień Dziadka',
|
|
|
|
Date.civil(2011,2,2) => 'Ofiarowanie Pańskie (Matki Boskiej Gromnicznej)',
|
|
|
|
Date.civil(2011,2,14) => 'Dzień Zakochanych (Walentynki)',
|
|
|
|
Date.civil(2010,3,8) => 'Dzień Kobiet',
|
|
|
|
Date.civil(2011,3,10) => 'Dzień Mężczyzn',
|
|
|
|
Date.civil(2011,4,1) => 'Prima Aprilis',
|
|
|
|
Date.civil(2010,4,22) => 'Międzynarodowy Dzień Ziemi',
|
|
|
|
Date.civil(2011,5,2) => 'Dzień Flagi Rzeczpospolitej Polskiej',
|
|
|
|
Date.civil(2010,6,23) => 'Dzień Ojca',
|
|
|
|
Date.civil(2011,9,30) => 'Dzień Chłopaka',
|
|
|
|
Date.civil(2011,10,14) => 'Dzień Nauczyciela (Dzień Edukacji Narodowej)',
|
|
|
|
Date.civil(2011,11,2) => 'Dzień Zaduszny',
|
|
|
|
Date.civil(2011,11,29) => 'Andrzejki',
|
|
|
|
Date.civil(2011,12,4) => 'Barbórka (Dzień Górnika, Naftowca i Gazownika)',
|
|
|
|
Date.civil(2011,12,6) => 'Mikołajki',
|
|
|
|
Date.civil(2011,12,24) => 'Wigilia Bożego Narodzenia',
|
|
|
|
Date.civil(2011,12,31) => 'Sylwester'}.each do |date, name|
|
|
|
|
assert_equal name, (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
|
|
end
|
|
|
|
|
|
|
|
# informal
|
|
|
|
{Date.civil(2011,1,21) => 'Dzień Babci',
|
|
|
|
Date.civil(2011,1,22) => 'Dzień Dziadka',
|
|
|
|
Date.civil(2011,2,2) => 'Ofiarowanie Pańskie (Matki Boskiej Gromnicznej)',
|
|
|
|
Date.civil(2011,2,14) => 'Dzień Zakochanych (Walentynki)',
|
|
|
|
Date.civil(2010,3,8) => 'Dzień Kobiet',
|
|
|
|
Date.civil(2011,3,10) => 'Dzień Mężczyzn',
|
|
|
|
Date.civil(2011,4,1) => 'Prima Aprilis',
|
|
|
|
Date.civil(2010,4,22) => 'Międzynarodowy Dzień Ziemi',
|
|
|
|
Date.civil(2011,5,2) => 'Dzień Flagi Rzeczpospolitej Polskiej',
|
|
|
|
Date.civil(2010,6,23) => 'Dzień Ojca',
|
|
|
|
Date.civil(2011,9,30) => 'Dzień Chłopaka',
|
|
|
|
Date.civil(2011,10,14) => 'Dzień Nauczyciela (Dzień Edukacji Narodowej)',
|
|
|
|
Date.civil(2011,11,2) => 'Dzień Zaduszny',
|
|
|
|
Date.civil(2011,11,29) => 'Andrzejki',
|
|
|
|
Date.civil(2011,12,4) => 'Barbórka (Dzień Górnika, Naftowca i Gazownika)',
|
|
|
|
Date.civil(2011,12,6) => 'Mikołajki',
|
|
|
|
Date.civil(2011,12,24) => 'Wigilia Bożego Narodzenia',
|
|
|
|
Date.civil(2011,12,31) => 'Sylwester'}.each do |date, name|
|
|
|
|
assert_equal nil, (Holidays.on(date, :pl)[0] || {})[:name]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Objawienie Pańskie (święto Trzech Króli) -- formal since 2011
|
|
|
|
[Date.civil(2008,1,6), Date.civil(2009,1,6), Date.civil(2010,1,6)].each do |date|
|
|
|
|
assert_equal nil, (Holidays.on(date, :pl)[0] || {})[:name]
|
|
|
|
end
|
|
|
|
[Date.civil(2008,1,6), Date.civil(2009,1,6), Date.civil(2010,1,6)].each do |date|
|
|
|
|
assert_equal 'Objawienie Pańskie (święto Trzech Króli)', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
|
|
end
|
|
|
|
[Date.civil(2011,1,6), Date.civil(2012,1,6), Date.civil(2013,1,6)].each do |date|
|
|
|
|
assert_equal 'Objawienie Pańskie (święto Trzech Króli)', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Tłusty Czwartek
|
|
|
|
[Date.civil(2008,1,31), Date.civil(2009,2,19), Date.civil(2010,2,11),
|
|
|
|
Date.civil(2011,3,3), Date.civil(2012,2,16)].each do |date|
|
|
|
|
assert_equal 'Tłusty Czwartek', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Ostatki
|
|
|
|
[Date.civil(2008,2,5), Date.civil(2009,2,24), Date.civil(2010,2,16),
|
|
|
|
Date.civil(2011,3,8), Date.civil(2012,2,21)].each do |date|
|
|
|
|
assert_equal 'Ostatki', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Środa Popielcowa
|
|
|
|
[Date.civil(2008,2,6), Date.civil(2009,2,25), Date.civil(2010,2,17),
|
|
|
|
Date.civil(2011,3,9), Date.civil(2012,2,22)].each do |date|
|
|
|
|
assert_equal 'Środa Popielcowa', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Niedziela Palmowa
|
|
|
|
[Date.civil(2008,3,16), Date.civil(2009,4,5), Date.civil(2010,3,28),
|
|
|
|
Date.civil(2011,4,17), Date.civil(2012,4,1)].each do |date|
|
|
|
|
assert_equal 'Niedziela Palmowa', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Wielki Czwartek
|
|
|
|
[Date.civil(2008,3,20), Date.civil(2009,4,9), Date.civil(2010,4,1),
|
|
|
|
Date.civil(2011,4,21), Date.civil(2012,4,5)].each do |date|
|
|
|
|
assert_equal 'Wielki Czwartek', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Wielki Piątek
|
|
|
|
[Date.civil(2008,3,21), Date.civil(2009,4,10), Date.civil(2010,4,2),
|
|
|
|
Date.civil(2011,4,22), Date.civil(2012,4,6)].each do |date|
|
|
|
|
assert_equal 'Wielki Piątek', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Wielka Sobota
|
|
|
|
[Date.civil(2008,3,22), Date.civil(2009,4,11), Date.civil(2010,4,3),
|
|
|
|
Date.civil(2011,4,23), Date.civil(2012,4,7)].each do |date|
|
|
|
|
assert_equal 'Wielka Sobota', (Holidays.on(date, :pl, :informal)[0] || {})[:name]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Niedziela Wielkanocna
|
|
|
|
[Date.civil(2008,3,23), Date.civil(2009,4,12), Date.civil(2010,4,4),
|
|
|
|
Date.civil(2011,4,24), Date.civil(2012,4,8)].each do |date|
|
|
|
|
assert_equal 'Niedziela Wielkanocna', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Poniedziałek Wielkanocny (Lany Poniedziałek)
|
|
|
|
[Date.civil(2008,3,24), Date.civil(2009,4,13), Date.civil(2010,4,5),
|
|
|
|
Date.civil(2011,4,25), Date.civil(2012,4,9)].each do |date|
|
|
|
|
assert_equal 'Poniedziałek Wielkanocny (Lany Poniedziałek)', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Zesłanie Ducha Świętego (Zielone Świątki)
|
|
|
|
[Date.civil(2008,5,11), Date.civil(2009,5,31), Date.civil(2010,5,23),
|
|
|
|
Date.civil(2011,6,12), Date.civil(2012,5,27)].each do |date|
|
|
|
|
assert_equal 'Zesłanie Ducha Świętego (Zielone Świątki)', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Uroczystość Najświętszego Ciała i Krwi Pańskiej (Boże Ciało)
|
|
|
|
[Date.civil(2008,5,22), Date.civil(2009,6,11), Date.civil(2010,6,3),
|
|
|
|
Date.civil(2011,6,23), Date.civil(2012,6,7)].each do |date|
|
|
|
|
assert_equal 'Uroczystość Najświętszego Ciała i Krwi Pańskiej (Boże Ciało)', (Holidays.on(date, :pl)[0] || {})[:name]
|
|
|
|
end
|
|
|
|
|
|
|
|
# Wniebowzięcie Najświętszej Maryi Panny & Święto Wojska Polskiego
|
|
|
|
assert_equal 'Wniebowzięcie Najświętszej Maryi Panny', (Holidays.on(Date.civil(2011,8,15), :pl)[0] || {})[:name]
|
|
|
|
assert_equal 'Święto Wojska Polskiego', (Holidays.on(Date.civil(2011,8,15), :pl)[1] || {})[:name]
|