Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Andalusia region (AN) holidays #56

Closed
wants to merge 12 commits into from
108 changes: 102 additions & 6 deletions holidata/holidays/es-ES.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,115 @@
class es_ES(Locale):
"""
01-01: [NF] Año Nuevo
01-06: [NRF] Día de los Reyes
01-06: [NRF] Epifanía del Señor
02-28: [AN] [F] Día de Andalucía
05-01: [NF] Fiesta del Trabajo
08-15: [NRF] Asunción de la Virgen
10-12: [NF] Fiesta Nacional de España
11-01: [NRF] Dia de todos los Santos
12-06: [NF] Dia de la Constitución
11-01: [NRF] Todos los Santos
12-06: [NF] Día de la Constitución Española
12-08: [NRF] Inmaculada Concepción
12-24: [NRF] Noche Buena
12-25: [NRF] Navidad
12-31: [NF] Noche Vieja
12-25: [NRF] Natividad del Señor
3 days before Easter: [AN] [RV] Jueves Santo
2 days before Easter: [NRV] Viernes Santo
Easter: [NRV] Pascua
"""

locale = "es-ES"
easter_type = EASTER_WESTERN

def ano_nuevo_en_domingo(self):
date = SmartDayArrow(self.year, 1, 1)
if date.weekday() == 'sunday':
return [Holiday(
locale=self.locale,
region="AN",
date=date.shift(1),
desctription="Lunes siguiente a Año Nuevo",
flags="V",
notes="")]
return []

def epifania_del_senor_en_domingo(self):
date = SmartDayArrow(self.year, 1, 6)
if date.weekday() == 'sunday':
return [Holiday(
locale=self.locale,
region="AN",
date=date.shift(1),
desctription="Lunes siguiente a la Epifanía del Señor",
flags="RV",
notes="")]
return []

def dia_de_andalucia_en_domingo(self):
date = SmartDayArrow(self.year, 2, 28)
if date.weekday() == 'sunday':
return [Holiday(
locale=self.locale,
region="AN",
date=date.shift(1),
desctription="Lunes siguiente al Día de Andalucía",
flags="V",
notes="")]
return []

def fiesta_del_trabajo_en_domingo(self):
date = SmartDayArrow(self.year, 5, 1)
if date.weekday() == 'sunday':
return [Holiday(
locale=self.locale,
region="AN",
date=date.shift(1),
desctription="Lunes siguiente a la Fiesta del Trabajo",
flags="V",
notes="")]
return []

def todos_los_santos_en_domingo(self):
date = SmartDayArrow(self.year, 11, 1)
if date.weekday() == 'sunday':
return [Holiday(
locale=self.locale,
region="AN",
date=date.shift(1),
desctription="Lunes siguiente a Todos los Santos",
flags="RV",
notes="")]
return []

def constitucion_espanola_en_domingo(self):
date = SmartDayArrow(self.year, 12, 6)
if date.weekday() == 'sunday':
return [Holiday(
locale=self.locale,
region="AN",
date=date.shift(1),
desctription="Lunes siguiente a la Constitución Española",
flags="V",
notes="")]
return []

def inmaculada_concepcion_en_domingo(self):
date = SmartDayArrow(self.year, 12, 8)
if date.weekday() == 'sunday':
return [Holiday(
locale=self.locale,
region="AN",
date=date.shift(1),
desctription="Lunes siguiente a Inmaculada Concepción",
flags="RV",
notes="")]
return []

def navidad_en_domingo(self):
date = SmartDayArrow(self.year, 12, 25)
if date.weekday() == 'sunday':
return [Holiday(
locale=self.locale,
region="AN",
date=date.shift(1),
desctription="Lunes siguiente a Navidad",
flags="RV",
notes="")]
return []