holidays/data/es.yaml
2007-12-05 22:27:05 +00:00

161 lines
No EOL
4.7 KiB
YAML

# Spanish holiday definitions for the Ruby Holiday gem.
#
# Including the Balearic Islands and the Canary Islands.
#
# Updated: 2008-11-29.
#
# Sources:
# - http://en.wikipedia.org/wiki/Public_holidays_in_Spain
# - http://www.timeanddate.com/calendar/index.html?country=16
#
# Notes:
# - Valencia is encoded as both es_v and es_vc
---
months:
0:
- name: Jueves Santo
regions: [es_pv, es_ct, es_na, es_v, es_vc]
function: easter(year)-3
- name: Viernes Santo
regions: [es]
function: easter(year)-2
- name: Lunes de Pascua
regions: [es_pv, es_ct, es_na, es_v, es_vc]
function: easter(year)+1
1:
- name: Año Nuevo
regions: [es]
mday: 1
- name: Día de Reyes
regions: [es]
mday: 6
2:
- name: Día de Andalucía
regions: [es_an]
mday: 28
3:
- name: Día de las Islas Baleares
regions: [es_ib]
mday: 1
- name: San José
regions: [es_v, es_vc, es_cm, es_mu, es_m]
mday: 19
4:
- name: San Jorge
regions: [es_ar, es_cl]
mday: 23
- name: Día de Aragón
regions: [es_ar]
mday: 23
5:
- name: Día del Trabajador
regions: [es]
mday: 1
- name: Fiesta de la Comunidad
regions: [es_m]
mday: 2
- name: Día de las Canarias
regions: [es_cn]
mday: 30
- name: Día de la Región Castilla-La Mancha
regions: [es_cm]
mday: 31
6:
- name: Día de la Región de Murcia
regions: [es_mu]
mday: 9
- name: Día de La Rioja
regions: [es_lo]
mday: 9
7:
- name: Santiago Apostol
regions: [es_ga]
mday: 23
8:
- name: Asunción
regions: [es]
mday: 15
9:
- name: Día de Ceuta
regions: [es_ce]
mday: 2
- name: Día de Asturias
regions: [es_o]
mday: 8
- name: Día de Extremadura
regions: [es_ex]
mday: 8
- name: Fiesta Nacional de Cataluña
regions: [es_ct]
mday: 11
10:
- name: Día de Valencia
regions: [es_vc, es_v]
mday: 9
- name: Día de la Hispanidad
regions: [es]
mday: 12
11:
- name: Todos los Santos
regions: [es]
mday: 1
12:
- name: Día de la Constitución
regions: [es]
mday: 6
- name: Inmaculada Concepción
regions: [es]
mday: 8
- name: Navidad del Señor
regions: [es]
mday: 25
- name: San Esteban
regions: [es_ib, es_ct]
mday: 26
tests: |
{Date.civil(2009,1,1) => 'Año Nuevo',
Date.civil(2009,1,6) => 'Día de Reyes',
Date.civil(2009,4,10) => 'Viernes Santo',
Date.civil(2009,5,1) => 'Día del Trabajador',
Date.civil(2009,8,15) => 'Asunción',
Date.civil(2009,10,12) => 'Día de la Hispanidad',
Date.civil(2009,11,1) => 'Todos los Santos',
Date.civil(2009,12,6) => 'Día de la Constitución',
Date.civil(2009,12,8) => 'Inmaculada Concepción',
Date.civil(2009,12,25) => 'Navidad del Señor'}.each do |date, name|
assert_equal name, Holidays.on(date, :es, :informal)[0][:name]
end
[:es_pv, :es_ct, :es_na, :es_v, :es_vc, :es_].each do |r|
assert_equal 'Jueves Santo', Date.civil(2009,4,9).holidays(r)[0][:name]
assert_equal 'Lunes de Pascua', Date.civil(2009,4,13).holidays(r)[0][:name]
end
[:es_v, :es_vc, :es_cm, :es_mu, :es_m, :es_].each do |r|
assert_equal 'San José', Date.civil(2009,3,19).holidays(r)[0][:name]
end
[:es_ar, :es_cl, :es_].each do |r|
assert_equal 'San Jorge', Date.civil(2009,4,23).holidays(r)[0][:name]
end
[:es_vc, :es_v, :es_].each do |r|
assert_equal 'Día de Valencia', Date.civil(2009,10,9).holidays(r)[0][:name]
end
[:es_ib, :es_ct, :es_].each do |r|
assert_equal 'San Esteban', Date.civil(2009,12,26).holidays(r)[0][:name]
end
assert_equal 'Día de Andalucía', Date.civil(2009,2,28).holidays(:es_an)[0][:name]
assert_equal 'Día de las Islas Baleares', Date.civil(2009,3,1).holidays(:es_ib)[0][:name]
assert_equal 'Fiesta de la Comunidad', Date.civil(2006,5,2).holidays(:es_m)[0][:name]
assert_equal 'Día de las Canarias', Date.civil(2006,5,30).holidays(:es_cn)[0][:name]
assert_equal 'Día de la Región Castilla-La Mancha', Date.civil(2009,5,31).holidays(:es_cm)[0][:name]
assert_equal 'Día de la Región de Murcia', Date.civil(2009,6,9).holidays(:es_mu)[0][:name]
assert_equal 'Día de La Rioja', Date.civil(2009,6,9).holidays(:es_lo)[0][:name]
assert_equal 'Santiago Apostol', Date.civil(2009,7,23).holidays(:es_ga)[0][:name]
assert_equal 'Día de Ceuta', Date.civil(2009,9,2).holidays(:es_ce)[0][:name]
assert_equal 'Día de Asturias', Date.civil(2009,9,8).holidays(:es_o)[0][:name]
assert_equal 'Día de Extremadura', Date.civil(2009,9,8).holidays(:es_ex)[0][:name]
assert_equal 'Fiesta Nacional de Cataluña', Date.civil(2009,9,11).holidays(:es_ct)[0][:name]