holidays/data/br.yaml

75 lines
2 KiB
YAML
Raw Normal View History

2011-04-29 23:41:16 +02:00
# Brazilian holiday definitions for the Ruby Holiday gem.
# Provided by Rogério Carrasqueira
#
# Updated: 2008-11-28.
# Sources:
# - http://pt.wikipedia.org/wiki/Feriados_no_Brasil
---
months:
0:
- name: Carnaval # same as Shrove Tuesday
regions: [br]
function: easter(year)-47
type: informal
- name: Sexta-feira Santa
regions: [br]
function: easter(year)-2
- name: Páscoa
regions: [br]
function: easter(year)
- name: Corpus Christ
regions: [br]
function: easter(year)+60
1:
- name: Dia da Confraternização Universal
regions: [br]
mday: 1
4:
- name: Dia de Tiradentes
regions: [br]
mday: 21
5:
- name: Dia do Trabalho
regions: [br]
mday: 1
9:
- name: Proclamação da Independência
regions: [br]
mday: 7
10:
- name: Dia de Nossa Senhora Aparecida
regions: [br]
mday: 12
11:
- name: Dia de Finados
regions: [br]
mday: 2
- name: Proclamação da República
regions: [br]
mday: 15
12:
- name: Natal
regions: [br]
mday: 25
tests: |
{Date.civil(2008,1,1) => 'Dia da Confraternização Universal',
Date.civil(2005,2,8) => 'Carnaval',
Date.civil(2006,2,28) => 'Carnaval',
Date.civil(2007,2,20) => 'Carnaval',
Date.civil(2008,2,5) => 'Carnaval',
Date.civil(2008,3,21) => 'Sexta-feira Santa',
Date.civil(2008,3,23) => 'Páscoa',
Date.civil(2008,4,21) => 'Dia de Tiradentes',
Date.civil(2008,5,1) => 'Dia do Trabalho',
Date.civil(2005,5,26) => 'Corpus Christ',
Date.civil(2007,6,7) => 'Corpus Christ',
Date.civil(2008,5,22) => 'Corpus Christ',
Date.civil(2008,9,7) => 'Proclamação da Independência',
Date.civil(2008,10,12) => 'Dia de Nossa Senhora Aparecida',
Date.civil(2008,11,2) => 'Dia de Finados',
Date.civil(2008,11,15) => 'Proclamação da República',
Date.civil(2008,12,25) => 'Natal'}.each do |date, name|
assert_equal name, (Holidays.on(date, :br, :informal)[0] || {})[:name]
end