Skip to content

Commit

Permalink
Working on English references
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherthompson81 committed Feb 15, 2020
1 parent 192e0e8 commit 48972ba
Show file tree
Hide file tree
Showing 13 changed files with 468 additions and 140 deletions.
2 changes: 1 addition & 1 deletion countries/italy.pgsql
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ BEGIN
RETURN NEXT t_holiday;
ELSIF p_province = 'RM' THEN
-- Saints Peter and Paul
t_holiday.reference := 'Saints Peter and Paul';
t_holiday.reference := 'Saint Peter and Saint Paul';
t_holiday.datestamp := make_date(t_year, JUNE, 29);
t_holiday.description := 'Santi Pietro e Paolo';
RETURN NEXT t_holiday;
Expand Down
45 changes: 29 additions & 16 deletions countries/peru.pgsql
Original file line number Diff line number Diff line change
Expand Up @@ -56,76 +56,89 @@ BEGIN
-- New Year's Day
t_holiday.reference := 'New Year''s Day';
t_holiday.datestamp := make_date(t_year, JANUARY, 1);
t_holiday.description := 'Año Nuevo [New Year''s Day]';
t_holiday.description := 'Año Nuevo';
RETURN NEXT t_holiday;

-- Feast of Saints Peter and Paul
t_holiday.reference := 'Feast of Saints Peter and Paul';
t_holiday.description := 'San Pedro y San Pablo [Feast of Saints Peter and Paul]';
t_holiday.description := 'San Pedro y San Pablo';
t_holiday.datestamp := make_date(t_year, JUNE, 29);
RETURN NEXT t_holiday;

-- Independence Day
t_holiday.reference := 'Independence Day';
t_holiday.description := 'Día de la Independencia [Independence Day]';
t_holiday.description := 'Día de la Independencia';
t_holiday.datestamp := make_date(t_year, JULY, 28);
RETURN NEXT t_holiday;

-- Independence Day (2)
t_holiday.reference := 'Independence Day (2)';
t_holiday.description := 'Día de las Fuerzas Armadas y la Policía del Perú';
t_holiday.datestamp := make_date(t_year, JULY, 29);
RETURN NEXT t_holiday;

-- Santa Rosa de Lima
t_holiday.reference := 'Santa Rosa de Lima';
t_holiday.description := 'Día de Santa Rosa de Lima';
t_holiday.datestamp := make_date(t_year, AUGUST, 30);
RETURN NEXT t_holiday;

-- Battle of Angamos
t_holiday.description := 'Combate Naval de Angamos [Battle of Angamos]';
t_holiday.reference := 'Battle of Angamos';
t_holiday.description := 'Combate Naval de Angamos';
t_holiday.datestamp := make_date(t_year, OCTOBER, 8);
RETURN NEXT t_holiday;

-- Easter related holidays
t_datestamp := holidays.easter(t_year);

-- Holy Thursday
-- Maundy Thursday
t_holiday.reference := 'Maundy Thursday';
t_holiday.datestamp := holidays.find_nth_weekday_date(t_datestamp, THURSDAY, -1);
t_holiday.description := 'Jueves Santo [Maundy Thursday]';
t_holiday.description := 'Jueves Santo';
RETURN NEXT t_holiday;

-- Good Friday
t_holiday.reference := 'Good Friday';
t_holiday.datestamp := holidays.find_nth_weekday_date(t_datestamp, FRIDAY, -1);
t_holiday.description := 'Viernes Santo [Good Friday]';
t_holiday.description := 'Viernes Santo';
RETURN NEXT t_holiday;

-- Holy Saturday
t_holiday.reference := 'Holy Saturday';
t_holiday.datestamp := holidays.find_nth_weekday_date(t_datestamp, SATURDAY, -1);
t_holiday.description := 'Sábado de Gloria [Holy Saturday]';
t_holiday.description := 'Sábado de Gloria';
RETURN NEXT t_holiday;

-- Easter Sunday
t_holiday.reference := 'Easter Sunday';
t_holiday.datestamp := t_datestamp;
t_holiday.description := 'Domingo de Resurrección [Easter Sunday]';
t_holiday.description := 'Domingo de Resurrección';
RETURN NEXT t_holiday;

-- Labor Day
-- Labour Day
t_holiday.reference := 'Labour Day';
t_holiday.datestamp := make_date(t_year, MAY, 1);
t_holiday.description := 'Día del Trabajo [Labour Day]';
t_holiday.description := 'Día del Trabajo';
RETURN NEXT t_holiday;

-- All Saints Day
t_holiday.description := 'Día de Todos Los Santos [All Saints Day]';
-- All Saints' Day
t_holiday.reference := 'All Saints'' Day';
t_holiday.description := 'Día de Todos Los Santos';
t_holiday.datestamp := make_date(t_year, NOVEMBER, 1);
RETURN NEXT t_holiday;

-- Inmaculada Concepción
t_holiday.description := 'Inmaculada Concepción [Immaculate Conception]';
-- Immaculate Conception
t_holiday.reference := 'Immaculate Conception';
t_holiday.description := 'Inmaculada Concepción';
t_holiday.datestamp := make_date(t_year, DECEMBER, 8);
RETURN NEXT t_holiday;

-- Christmas
-- Christmas Day
t_holiday.reference := 'Christmas Day';
t_holiday.datestamp := make_date(t_year, DECEMBER, 25);
t_holiday.description := 'Navidad [Christmas]';
t_holiday.description := 'Navidad';
RETURN NEXT t_holiday;

END LOOP;
Expand Down
26 changes: 25 additions & 1 deletion countries/poland.pgsql
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,13 @@ BEGIN
t_holiday.end_time := '24:00:00'::TIME;

-- New Year's Day
t_holiday.reference := 'New Year''s Day';
t_holiday.datestamp := make_date(t_year, JANUARY, 1);
t_holiday.description := 'Nowy Rok';
RETURN NEXT t_holiday;

-- Epiphany
t_holiday.reference := 'Epiphany';
IF t_year >= 2011 THEN
t_holiday.datestamp := make_date(t_year, JANUARY, 6);
t_holiday.description := 'Święto Trzech Króli';
Expand All @@ -66,54 +69,75 @@ BEGIN
-- Easter Related Holidays
t_datestamp := holidays.easter(t_year);

-- Easter
-- Easter Sunday
t_holiday.reference := 'Easter Sunday';
t_holiday.datestamp := t_datestamp;
t_holiday.description := 'Niedziela Wielkanocna';
RETURN NEXT t_holiday;

-- Easter Monday
t_holiday.reference := 'Easter Monday';
t_holiday.datestamp := t_datestamp + '1 Days'::INTERVAL;
t_holiday.description := 'Poniedziałek Wielkanocny';
RETURN NEXT t_holiday;

-- Pentecost
t_holiday.reference := 'Pentecost';
t_holiday.datestamp := t_datestamp + '49 Days'::INTERVAL;
t_holiday.description := 'Zielone Świątki';
RETURN NEXT t_holiday;

-- Corpus Christi
t_holiday.reference := 'Corpus Christi';
t_holiday.datestamp := t_datestamp + '60 Days'::INTERVAL;
t_holiday.description := 'Dzień Bożego Ciała';
RETURN NEXT t_holiday;

-- Labour Day
t_holiday.reference := 'Labour Day';
IF t_year >= 1950 THEN
t_holiday.datestamp := make_date(t_year, MAY, 1);
t_holiday.description := 'Święto Państwowe';
RETURN NEXT t_holiday;
END IF;

-- Constitution Day
t_holiday.reference := 'Constitution Day';
IF t_year >= 1919 THEN
t_holiday.datestamp := make_date(t_year, MAY, 3);
t_holiday.description := 'Święto Narodowe Trzeciego Maja';
RETURN NEXT t_holiday;
END IF;

-- Assumption
t_holiday.reference := 'Assumption';
t_holiday.datestamp := make_date(t_year, AUGUST, 15);
t_holiday.description := 'Wniebowzięcie Najświętszej Marii Panny';
RETURN NEXT t_holiday;

-- All Saints' Day
t_holiday.reference := 'All Saints'' Day';
t_holiday.datestamp := make_date(t_year, NOVEMBER, 1);
t_holiday.description := 'Uroczystość Wszystkich świętych';
RETURN NEXT t_holiday;

-- Remembrance Day (?)
-- Independence Day
t_holiday.reference := 'Independence Day';
IF (t_year BETWEEN 1937 AND 1945) OR t_year >= 1989 THEN
t_holiday.datestamp := make_date(t_year, NOVEMBER, 11);
t_holiday.description := 'Narodowe Święto Niepodległości';
RETURN NEXT t_holiday;
END IF;

-- Christmas Day
t_holiday.reference := 'Christmas Day';
t_holiday.datestamp := make_date(t_year, DECEMBER, 25);
t_holiday.description := 'Boże Narodzenie (pierwszy dzień)';
RETURN NEXT t_holiday;

-- Second Day of Christmas
t_holiday.reference := 'Second Day of Christmas';
t_holiday.datestamp := make_date(t_year, DECEMBER, 26);
t_holiday.description := 'Boże Narodzenie (drugi dzień)';
RETURN NEXT t_holiday;
Expand Down
132 changes: 102 additions & 30 deletions countries/portugal.pgsql
Original file line number Diff line number Diff line change
Expand Up @@ -53,86 +53,158 @@ BEGIN
t_holiday.end_time := '24:00:00'::TIME;

-- New Year's Day
t_holiday.reference := 'New Year''s Day';
t_holiday.datestamp := make_date(t_year, JANUARY, 1);
t_holiday.description := 'Ano Novo';
RETURN NEXT t_holiday;

-- Easter related holidays
t_datestamp := holidays.easter(t_year);

-- carnival is no longer a holiday, but some companies let workers off.
-- @todo recollect the years in which it was a public holiday
-- self[e - rd(days=47)] = 'Carnaval'
-- Carnival
-- Shrove Tuesday
-- Optional
t_holiday.reference := 'Shrove Tuesday';
t_holiday.datestamp := t_datestamp - '47 Days'::INTERVAL;
t_holiday.description := 'Carnaval';
t_holiday.authority := 'optional';
t_holiday.day_off := FALSE;
RETURN NEXT t_holiday;
t_holiday.authority := 'national';
t_holiday.day_off := TRUE;

-- Good Friday
t_holiday.reference := 'Good Friday';
t_holiday.datestamp := t_datestamp - '2 Days'::INTERVAL;
t_holiday.description := 'Sexta-feira Santa';
RETURN NEXT t_holiday;

t_holiday.datestamp := make_date(t_year, JANUARY, 1);
-- Easter Sunday
t_holiday.reference := 'Easter Sunday';
t_holiday.datestamp := t_datestamp;
t_holiday.description := 'Páscoa';
RETURN NEXT t_holiday;

-- Revoked holidays in 2013–2015
-- Corpus Christi
-- Revoked holiday in 2013–2015
t_holiday.reference := 'Corpus Christi';
IF t_year < 2013 OR t_year > 2015 THEN
t_holiday.datestamp := t_datestamp + '60 Days'::INTERVAL;
t_holiday.description := 'Corpo de Deus';
RETURN NEXT t_holiday;
t_holiday.datestamp := make_date(t_year, OCTOBER, 5);
t_holiday.description := 'Implantação da República';
RETURN NEXT t_holiday;
t_holiday.datestamp := make_date(t_year, NOVEMBER, 1);
t_holiday.description := 'Dia de Todos os Santos';
RETURN NEXT t_holiday;
t_holiday.datestamp := make_date(t_year, DECEMBER, 1);
t_holiday.description := 'Restauração da Independência';
RETURN NEXT t_holiday;
END IF;

-- Liberty Day
t_holiday.reference := 'Liberty Day';
t_holiday.datestamp := make_date(t_year, APRIL, 25);
t_holiday.description := 'Dia da Liberdade';
RETURN NEXT t_holiday;

-- Labour Day
t_holiday.reference := 'Labour Day';
t_holiday.datestamp := make_date(t_year, MAY, 1);
t_holiday.description := 'Dia do Trabalhador';
RETURN NEXT t_holiday;

-- Portugal Day
t_holiday.reference := 'Portugal Day';
t_holiday.datestamp := make_date(t_year, JUNE, 10);
t_holiday.description := 'Dia de Portugal';
RETURN NEXT t_holiday;

-- St. Anthony's Day
-- Municipal Holiday
-- Lisbon, Vila Real
t_holiday.reference := 'St. Anthony''s Day';
t_holiday.datestamp := make_date(t_year, JUNE, 13);
t_holiday.description := 'Dia de Santo António';
t_holiday.authority := 'municipal';
RETURN NEXT t_holiday;
t_holiday.authority := 'national';

-- Assumption
t_holiday.reference := 'Assumption';
t_holiday.datestamp := make_date(t_year, AUGUST, 15);
t_holiday.description := 'Assunção de Nossa Senhora';
RETURN NEXT t_holiday;

-- Republic Implantation
-- Revoked holiday in 2013–2015
t_holiday.reference := 'Republic Implantation';
IF t_year < 2013 OR t_year > 2015 THEN
t_holiday.datestamp := make_date(t_year, OCTOBER, 5);
t_holiday.description := 'Implantação da República';
RETURN NEXT t_holiday;
END IF;

-- All Saints' Day
-- Revoked holiday in 2013–2015
t_holiday.reference := 'All Saints'' Day';
IF t_year < 2013 OR t_year > 2015 THEN
t_holiday.datestamp := make_date(t_year, NOVEMBER, 1);
t_holiday.description := 'Dia de Todos os Santos';
RETURN NEXT t_holiday;
END IF;

-- Restoration of Independence
-- Revoked holiday in 2013–2015
t_holiday.reference := 'Restoration of Independence';
IF t_year < 2013 OR t_year > 2015 THEN
t_holiday.datestamp := make_date(t_year, DECEMBER, 1);
t_holiday.description := 'Restauração da Independência';
RETURN NEXT t_holiday;
END IF;

-- Immaculate Conception
t_holiday.reference := 'Immaculate Conception';
t_holiday.datestamp := make_date(t_year, DECEMBER, 8);
t_holiday.description := 'Imaculada Conceição';
RETURN NEXT t_holiday;
t_holiday.datestamp := make_date(t_year, DECEMBER, 25);
t_holiday.description := 'Christmas Day';
RETURN NEXT t_holiday;

-- Adds extended days that most people have as a bonus from their companies:
-- - Carnival
-- - the day before and after xmas
-- - the day before the new year
-- - Lisbon's city holiday
-- Porting Note: Exclude from select if you desire these to be omitted
t_holiday.datestamp := t_datestamp - '47 Days'::INTERVAL;
t_holiday.description := 'Carnaval';
RETURN NEXT t_holiday;

-- Christmas Eve
-- Observance
t_holiday.reference := 'Christmas Eve';
t_holiday.datestamp := make_date(t_year, DECEMBER, 24);
t_holiday.description := 'Vespera de Natal';
t_holiday.authority := 'observance';
t_holiday.day_off := FALSE;
RETURN NEXT t_holiday;
t_holiday.authority := 'national';
t_holiday.day_off := TRUE;

-- Christmas Day
t_holiday.reference := 'Christmas Day';
t_holiday.datestamp := make_date(t_year, DECEMBER, 25);
t_holiday.description := 'Christmas Day';
RETURN NEXT t_holiday;

-- Second Day of Christmas
-- Optional (?)
-- [Madeira] - en: 1st Octave; pt: Primeira Oitava
t_holiday.reference := 'Second Day of Christmas';
t_holiday.datestamp := make_date(t_year, DECEMBER, 26);
t_holiday.description := '26 de Dezembro';
t_holiday.authority := 'optional';
t_holiday.day_off := FALSE;
RETURN NEXT t_holiday;
t_holiday.authority := 'national';
t_holiday.day_off := TRUE;

-- New Year's Eve
-- Observance
t_holiday.reference := 'New Year''s Eve';
t_holiday.datestamp := make_date(t_year, DECEMBER, 31);
t_holiday.description := 'Vespera de Ano novo';
t_holiday.authority := 'observance';
t_holiday.day_off := FALSE;
RETURN NEXT t_holiday;
t_holiday.datestamp := make_date(t_year, JUNE, 13);
t_holiday.description := 'Dia de Santo António';
RETURN NEXT t_holiday;
t_holiday.authority := 'national';
t_holiday.day_off := TRUE;

-- TODO add bridging days
-- - get Holidays that occur on Tuesday and add Monday (-1 day)
-- - get Holidays that occur on Thursday and add Friday (+1 day)
-- Porting Note: I can't find a source that confirms this is law

END LOOP;
END;
Expand Down
Loading

0 comments on commit 48972ba

Please sign in to comment.