502 lines
No EOL
29 KiB
XML
502 lines
No EOL
29 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
|
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="LocalHolidays" script:language="StarBasic">Option Explicit
|
|
|
|
Sub Main
|
|
Call CalAutopilotTable()
|
|
End Sub
|
|
|
|
|
|
Sub FindWholeYearHolidays_FRANCE(ByVal YearInt as Integer)
|
|
Dim lEasterDate&
|
|
Dim lDate&
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 1), "Jour de l'an", cHolidayType_Full)
|
|
lEasterDate = CalEasterTable(YearInt)
|
|
CalInsertBankholiday(lEasterDate, "Pâques", cHolidayType_Full)
|
|
CalInsertBankholiday(lEasterDate + 10, "Pentecôte", cHolidayType_Full)
|
|
CalInsertBankholiday(lEasterDate + 39, "Ascension", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 1), "Fête du travail", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 8), "Victoire 1945", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 7, 14), "Fête Nationale", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 8, 15), "Assomption", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 11, 1), "Toussaint", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 11, 11), "Armistice ou Victoire 1918", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 25), "Noël", cHolidayType_Full)
|
|
End Sub
|
|
|
|
|
|
Sub FindWholeYearHolidays_SWED(ByVal YearInt as Integer)
|
|
Dim lDate&
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 1), "Nyårsdagen", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 6), "Trettondagen", cHolidayType_Full)
|
|
lDate = CalEasterTable(YearInt)
|
|
CalInsertBankholiday(lDate - 2, "Långfredagen", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate, "Påskdagen", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate + 1, "Annandag påsk", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate + 39, "Kristi himmelfärds dag", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate + 49, "Pingstdagen", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate + 50, "Annandag pingst", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 1), "1:a maj", cHolidayType_Full)
|
|
lDate = DateSerial(YearInt, 6, 20)
|
|
While (Weekday(lDate) <> 7) ' Saturday
|
|
lDate = lDate + 1
|
|
Wend
|
|
CalInsertBankholiday(lDate, "Midsommardagen", cHolidayType_Full)
|
|
lDate = DateSerial(YearInt, 10, 31)
|
|
While (Weekday(lDate) <> 7) ' Saturday
|
|
lDate = lDate + 1
|
|
Wend
|
|
CalInsertBankholiday(lDate, "Alla helgons dag", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 25), "Juldagen", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 26), "Annandag jul", cHolidayType_Full)
|
|
End Sub
|
|
|
|
|
|
Sub FindWholeYearHolidays_DK (ByVal YearInt as Integer)
|
|
Dim lDate&, VierterAdvent&
|
|
|
|
'New Year
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 1), "Nytårsdag", cHolidayType_Full)
|
|
lDate = CalEasterTable (YearInt)
|
|
'"Fasching"
|
|
CalInsertBankholiday(lDate-49, "Fastelavn", cHolidayType_Half)
|
|
'"Gründonnerstag"
|
|
CalInsertBankholiday(lDate-3, "Skærtorsdag", cHolidayType_Full)
|
|
'"Karfreitag"
|
|
CalInsertBankholiday(lDate-2, "Langfredag", cHolidayType_Full)
|
|
' Easter Sunday
|
|
CalInsertBankholiday(lDate, "Påskesøndag", cHolidayType_Full)
|
|
' Easter Monday
|
|
CalInsertBankholiday(lDate+1, "2. påskedag", cHolidayType_Full)
|
|
' 4th Friday after Easter
|
|
CalInsertBankholiday(lDate+26, "Store bededag", cHolidayType_Full)
|
|
' "Christi Himmelfahrt
|
|
CalInsertBankholiday(lDate+39, "Kristi himmelfahrt", cHolidayType_Full)
|
|
' "Pfingstsonntag"
|
|
CalInsertBankholiday(lDate+49, "Pinsesøndag", cHolidayType_Full)
|
|
' "Pfingstmontag"
|
|
CalInsertBankholiday(lDate+50, "2. pinsedag", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 6, 5), "Grundlovsdag", cHolidayType_Full)
|
|
'Christmas Days
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 25), "1. juledag", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 26), "2. juledag", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 6), "Hellig 3 konger", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 3, 28), "Dr. Ingrid", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 4, 16), "Dr. Margrete", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 4, 16), "Palmesøndag", cHolidayType_Half)
|
|
' "Befreiungstag"
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 5), "Befrielsesdag", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 26), "Krpr. Frederik", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 6, 7), "Pr. Joachim", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 6, 11), "Pr. Henrik", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 6, 15), "Valdemarsdag", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 6, 24), "Skt. Hans", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 6, 30), "Prinsesse Alexandra", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 8, 28), "Pr. Nikolai", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 10, 24), "FN-dag", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 11, 11), "Morten Bisp", cHolidayType_Half)
|
|
' all half (Memorial Days)
|
|
'"Adventsfeiertage
|
|
VierterAdvent = DateSerial(YearInt, 12, 24)
|
|
While (Weekday(VierterAdvent) <> 1)
|
|
vierterAdvent = vierterAdvent - 1
|
|
Wend
|
|
CalInsertBankholiday(vierterAdvent-21, "1. søndag i advent", cHolidayType_Half)
|
|
CalInsertBankholiday(vierterAdvent-14, "2. søndag i advent", cHolidayType_Half)
|
|
CalInsertBankholiday(vierterAdvent-7, "3. søndag i advent", cHolidayType_Half)
|
|
CalInsertBankholiday(vierterAdvent, "4. søndag i advent", cHolidayType_Half)
|
|
'Christmas eve
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 24), "Juleaften", cHolidayType_Half)
|
|
'"Sylvester"
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 31), "Nytårsaften", cHolidayType_Half)
|
|
End Sub
|
|
|
|
|
|
Sub FindWholeYearHolidays_ITA(ByVal YearInt as Integer)
|
|
Dim lDate&
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 1), "Capodanno", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 6), "Epifania", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 4, 25), "Festa della liberazione", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 8, 15), "Ferragusto", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 11, 1), "Tutti i Santi", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 8), "Immacolata concezione", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 25), "Natale", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 26), "Santo Stefano", cHolidayType_Full)
|
|
lDate = CalEasterTable(YearInt)
|
|
CalInsertBankholiday(lDate, "Pasqua", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate+1, "Lunedì dell'Angelo", cHolidayType_Full)
|
|
End Sub
|
|
|
|
|
|
Sub FindWholeYearHolidays_SPAIN(ByVal YearInt as Integer)
|
|
Dim lDate&
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 1), "Año Nuevo", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 6), "Reyes", cHolidayType_Full)
|
|
lDate = CalEasterTable(YearInt)
|
|
CalInsertBankholiday(lDate-2, "Viernes Santo", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate+1, "Lunes de Pascua Florida", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate+39, "Día de la Ascensión", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 1), "Fiesta del Trabajo", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 8, 15), "Día de la Asunción", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 10, 12), "Fiesta de la Hispanidad", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 11, 1), "Todos los Santos", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 6), "Día de la Constitución", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 8), "La Inmaculada", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 25), "Navidad", cHolidayType_Full)
|
|
End Sub
|
|
|
|
|
|
Sub FindWholeYearHolidays_PORT(ByVal YearInt as Integer)
|
|
Dim lDate&
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 1), "Ano Novo", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 6), "Reis Magos", cHolidayType_Half)
|
|
lDate = CalEasterTable(YearInt)
|
|
CalInsertBankholiday(lDate-47, "Carnaval", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate-7, "Domingo de Ramos", cHolidayType_Half)
|
|
CalInsertBankholiday(lDate-2, "Sexta-feira Santa", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate, "Páscoa", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 4, 25), "25 de Abril", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 1), "Dia do Trabalhador", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 29), "Corpo de Deus", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 6, 10), "Dia de Camões e das Comunidades Portuguesas", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 6, 24), "S. João", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 6, 29), "S. Pedro", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 8, 15), "Assunção de Nossa Senhora", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 10, 5), "Implantação da República", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 11, 1), "Dia de Todos os Santos", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 8), "Imaculada Conceição", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 25), "Natal", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 1), "Restauração da Independência", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 31), "Passagem de Ano", cHolidayType_Half)
|
|
End Sub
|
|
|
|
|
|
Sub FindWholeYearHolidays_NL(ByVal YearInt as Integer)
|
|
Dim lDate&
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 1), "Nieuwjaarsdag", cHolidayType_Full)
|
|
lDate = CalEasterTable(YearInt)
|
|
CalInsertBankholiday(lDate, "1e Paasdag", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate + 1, "2e Paasdag", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate + 39, "Hemelvaartsdag", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate + 49, "1e Pinksterdag", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate + 50, "2e Pinksterdag", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 4, 30), "Koninginnedag", cHolidayType_Full)
|
|
' Bevrijdingsdag is celebrated every 5th year
|
|
If YearInt Mod 5 = 0 then
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 5), "Bevrijdingsdag", cHolidayType_Full)
|
|
End if
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 6), "Sinterklaas", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 25), "1e Kerstdag", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 26), "2e Kerstdag", cHolidayType_Full)
|
|
End Sub
|
|
|
|
|
|
Sub FindWholeYearHolidays_PL (ByVal YearInt as Integer)
|
|
Dim lDate&, OsternDate&
|
|
' New Year
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 1), "Nowy Rok", cHolidayType_Full)
|
|
' "Hl. 3 Könige"
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 6), "Trzech Króli", cHolidayType_Half)
|
|
' "Frauentag"
|
|
CalInsertBankholiday(DateSerial(YearInt, 3, 8), "Dzieñ Kobiet", cHolidayType_Half)
|
|
OsternDate = CalEasterTable(YearInt)
|
|
CalInsertBankholiday(OsternDate-2, "Wielki Pi¹tek", cHolidayType_Full)
|
|
CalInsertBankholiday(OsternDate, "Wielka Niedziela", cHolidayType_Full)
|
|
CalInsertBankholiday(OsternDate+1, "Lany Poniedzia³ek", cHolidayType_Full)
|
|
' Christi Himmelfahrt
|
|
CalInsertBankholiday(OsternDate+39, "Wniebowst¹pienie", cHolidayType_Full)
|
|
' Pfingsten
|
|
CalInsertBankholiday(OsternDate+49, "Zielone Œwi¹tki", cHolidayType_Full)
|
|
' Fronleichnam
|
|
CalInsertBankholiday(OsternDate+60, "Bo¿e Cia³o", cHolidayType_Full)
|
|
' First of May
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 1), "Œwiêto pracy", cHolidayType_Full)
|
|
' Memorial day of constitution
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 3), "Dzieñ konstytucji 3-go maja", cHolidayType_Full)
|
|
' "Kindertag"
|
|
CalInsertBankholiday(DateSerial(YearInt, 6, 1), "Dzieñ Dziecka", cHolidayType_Half)
|
|
' "Maria Himmelfahrt"
|
|
CalInsertBankholiday(DateSerial(YearInt, 8, 15), "Matki Boskiej Zielnej", cHolidayType_Half)
|
|
' "Allerheiligen"
|
|
CalInsertBankholiday(DateSerial(YearInt, 11, 1), "Wszystkich Œwiêtych", cHolidayType_Full)
|
|
' National day"
|
|
CalInsertBankholiday(DateSerial(YearInt, 11, 11), "Dzieñ niepod³eg³oœci", cHolidayType_Full)
|
|
' Christmas Eve
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 24), "Wigilia", cHolidayType_Half)
|
|
' Christmas
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 25), "Bo¿e Narodzenie", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 26), "Bo¿e Narodzenie", cHolidayType_Full)
|
|
' "Sylvester"
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 31), "Sylwester", cHolidayType_Half)
|
|
End Sub
|
|
|
|
|
|
Sub FindWholeYearHolidays_RU (ByVal YearInt as Integer)
|
|
Dim lDate&
|
|
' New Year
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 1), "Íîâûé ãîä", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 2), "Íîâûé ãîä", cHolidayType_Full)
|
|
' Russian Christmas"
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 7), "Ðîæäåñòâî", cHolidayType_Full)
|
|
' Woman Day
|
|
CalInsertBankholiday(DateSerial(YearInt, 3, 8), "Ìåæäóíàðîäíûé æåíñêèé äåíü Ïðàçäíèê âåñíû è òðóäà ", cHolidayType_Full)
|
|
' Easter, get it with look-up table
|
|
lDate = CalEasterTable(YearInt) + 7
|
|
CalInsertBankholiday(lDate, "Ïàñõà", cHolidayType_Full)
|
|
' First of May
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 1), "Ïðàçäíèê âåñíû è òðóäà ", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 2), "Ïðàçäíèê âåñíû è òðóäà", cHolidayType_Full)
|
|
' Victory of the second World War
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 9), "Äåíü Ïîáåäû", cHolidayType_Full)
|
|
' End of Soviet Union
|
|
CalInsertBankholiday(DateSerial(YearInt, 6, 12), "Äåíü íåçàâèñèìîñòè", cHolidayType_Full)
|
|
' Peace Day
|
|
CalInsertBankholiday(DateSerial(YearInt, 11, 7), "Äåíü ñîãëàñèÿ è ïðèìèðåíèÿÄåíü ñîãëàñèÿ è ïðèìèðåíèÿ", cHolidayType_Full)
|
|
' Constitution Day
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 12), "Äåíü êîíñòèòóöèè", cHolidayType_Full)
|
|
End Sub
|
|
|
|
|
|
Sub FindWholeYearHolidays_US(ByVal YearInt as Integer)
|
|
Dim lDate as Long
|
|
Dim lFirstNov as Long
|
|
Dim lElectDate as Long
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 1), "New Year's Day", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 2, 2), "Groundhog Day", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 2, 14), "Valentine's Day", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 3, 17), "St Patrick's Day", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 4, 1), "April Fools' Day", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 4, 22), "Earth Day", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 6), "Nurses' Day", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 6, 14), "Flag Day", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 6, 14), "Army Day", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 6, 19), "Juneteenth(Liberation of Slaves)", cHolidayType_Half)
|
|
|
|
CalInsertBankholiday(DateSerial(YearInt, 7, 4), "Independence Day", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 8, 1), "Air Force Day", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 8, 4), "Coast Guard Day", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 9, 17), "Citizenship Day or Constitution Day", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 10, 16), "Bosses' Day", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 10, 26 ), "Mother-in-Law's Day", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 10, 27), "Navy Day", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 10, 31), "Halloween", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 11, 10), "Marine Corps Day", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 11, 11), "Veteran's Day", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 7), "Pearl Harbor Remembrance Day", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 24), "Christmas Eve", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 25), "Christmas Day", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 31), "New Year's Eve", cHolidayType_Half)
|
|
|
|
CalInsertBankholiday(CalEasterTable(YearInt), "Easter Sunday", cHolidayType_Half)
|
|
|
|
' Inauguration Day occurs every 4 years (1997, 2001) in the year following the presidential election
|
|
' always on the 20th of January unless this is a Sunday in which case on Monday 21st January
|
|
If YearInt Mod 4 = 1 Then
|
|
lDate = DateSerial(YearInt, 1, 20)
|
|
If WeekDay(lDate) = 1 Then
|
|
CalInsertBankholiday(lDate + 1, "Inauguration Day", cHolidayType_Half)
|
|
Else
|
|
CalInsertBankholiday(lDate, "Inauguration Day", cHolidayType_Half)
|
|
End If
|
|
End If
|
|
' First Tuesday in November, but only after the 1st of November and only on evenly numbered years
|
|
If YearInt Mod 2 = 0 Then
|
|
lFirstNov = DateSerial(YearInt, 11, 1)
|
|
lElectDate = GetMonthDate(YearInt, 11, 3, 0)
|
|
If lElectDate > lFirstNov Then
|
|
CalInsertBankholiday(lElectDate, "Election Day", cHolidayType_Half)
|
|
Else
|
|
CalInsertBankholiday(lElectDate + 7, "Election Day", cHolidayType_Half)
|
|
End If
|
|
End If
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 1, 2, 14), "Martin Luther King Jr Day", cHolidayType_Full)
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 2, 2, 14), "President's Day", cHolidayType_Full)
|
|
' Mothers Day : 2nd Sunday in May, Full
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 5,1,7), "Mother's Day", cHolidayType_Full)
|
|
|
|
' Wednesday of the last full week of April Administrative Professionals' Day (formerly Secretaries' Day)
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 5, 7, -7)-3, "Administrative Professionals' Day", cHolidayType_Half)
|
|
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 5, 5, 0), "National Day of Prayer", cHolidayType_Half)
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 5, 7, 14), "Armed Forces Day", cHolidayType_Half)
|
|
' Fathers Day : 3rd Sunday in June
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 6,1,14), "Father's Day", cHolidayType_Half)
|
|
|
|
' Last Monday in May: Menorial Day, Full
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 6, 2, 0)-7, "Memorial Day", cHolidayType_Full)
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 7, 1, 21), "Parents' Day", cHolidayType_Half)
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 8, 1, 0), "Friendship Day", cHolidayType_Half)
|
|
|
|
' 1st Monday in Sep : Labor Day, Full
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 9, 2, 0), "Labor Day", cHolidayType_Full)
|
|
' Sunday after Labor Day Grandparents' Day
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 9, 2, 0)+6, "Grandparents' Day", cHolidayType_Half)
|
|
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 10, 1, 0), "National Children's Day", cHolidayType_Half)
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 10, 2, 7), "Columbus Day", cHolidayType_Full)
|
|
' Sweetest Day: Third Saturday in October
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 10, 7, 14), "Sweetest Day", cHolidayType_Half)
|
|
' 4th Thu in Nov : Thanksgiving, Full
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 11, 5, 21), "Thanksgiving", cHolidayType_Full)
|
|
End Sub
|
|
|
|
|
|
Sub FindWholeYearHolidays_JP(ByVal YearInt as Integer)
|
|
Dim lDate&
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 1), "元日", cHolidayType_Full)
|
|
' 2nd Monday in January
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 1, 2, 7), "成人の日", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 2, 11), "建国記念の日", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 3, 20), "春分の日", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 4, 29), "みどりの日", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 3), "憲法記念日", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 4), "国民の休日", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 5), "こどもの日", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 9, 23), "秋分の日", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 10, 2), "体育の日", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 11, 3), "文化の日", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 11, 23), "勤労感謝の日", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 23), "天皇誕生日", cHolidayType_Full)
|
|
If YearInt > 2002 Then
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 7, 2, 14), "海の日", cHolidayType_Full)
|
|
CalInsertBankholiday(GetMonthDate(YearInt, 9, 2, 14), "敬老の日", cHolidayType_Full)
|
|
Else
|
|
CalInsertBankholiday(DateSerial(YearInt, 7, 20), "海の日", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 9, 15), "敬老の日", cHolidayType_Full)
|
|
End If
|
|
End Sub
|
|
|
|
|
|
Sub FindWholeYearHolidays_TW(YearInt as Integer)
|
|
CalculateChineseNewYear(YearInt)
|
|
CalInsertBankholiday(DateSerial(YearInt, 2, 28), "和平紀念日", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 3, 8), "婦女節", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 3, 29), "革命先烈紀念日(青年節)", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 4, 4), "兒童節", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 4, 5), "民族掃墓節", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 1), "勞動節", cHolidayType_Full)
|
|
CalInsertBankholiday(GetNextWeekDay(YearInt, 5, 19, 2), "佛陀誕辰紀念日", cHolidayType_Full) ' Just like Columbus Day
|
|
CalInsertBankholiday(DateSerial(YearInt, 6, 15), "端午節", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 9, 3), "軍人節", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 9, 21), "中秋節", cHolidayType_Full)
|
|
CalInsertBankholiday(GetNextWeekDay(YearInt, 9, 28, 2), "孔子誕辰紀念日(教師節)", cHolidayType_Full) ' Just like Columnbusday
|
|
CalInsertBankholiday(DateSerial(YearInt, 10, 10), "國慶日", cHolidayType_Full)
|
|
CalInsertBankholiday(DateSerial(YearInt, 10, 25), "臺灣光復節", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 10, 31), "先總統 蔣公誕辰紀念日", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 11), "國父誕辰紀念日(中華文化復興節)", cHolidayType_Half)
|
|
CalInsertBankholiday(DateSerial(YearInt, 12, 25), "行憲紀念日", cHolidayType_Half)
|
|
End Sub
|
|
|
|
|
|
Function GetNextWeekDay(iYear as Integer, iMonth as Integer, iDay as Integer, iWeekDay as Integer)
|
|
Dim lDate as Long
|
|
Dim iCurWeekDay as Integer
|
|
lDate = DateSerial(iYear, iMonth, iDay)
|
|
iCurWeekDay = WeekDay(lDate)
|
|
While iCurWeekDay <> iWeekDay
|
|
lDate = lDate + 1
|
|
iCurWeekDay = WeekDay(lDate)
|
|
Wend
|
|
GetNextWeekDay() = lDate
|
|
End Function
|
|
|
|
|
|
Sub FindWholeYearHolidays_CN(YearInt as Integer)
|
|
CalculateChineseNewYear(YearInt)
|
|
CalInsertBankholiday(DateSerial(YearInt, 1, 1), "元旦", cHolidayType_Full) ' New Year
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 8), "妇女节", cHolidayType_Half) ' Women's Day
|
|
CalInsertBankholiday(DateSerial(YearInt, 4, 5), "清明节", cHolidayType_Half) ' Day of the deads
|
|
CalInsertBankholiday(DateSerial(YearInt, 5, 1), "劳动节", cHolidayType_Full) ' International Labour Day
|
|
CalInsertBankholiday(DateSerial(YearInt, 6, 1), "儿童节", cHolidayType_Half) ' Children's Day
|
|
CalInsertBankholiday(DateSerial(YearInt, 8, 1), "建军节", cHolidayType_Half) ' Foundation of military
|
|
CalInsertBankholiday(DateSerial(YearInt, 10, 1), "国庆节", cHolidayType_Full) ' National festival day
|
|
End Sub
|
|
|
|
|
|
' Unfortunately I could not find a Routine to convert a 'Moon Date' into a gregorian date
|
|
Sub CalculateChineseNewYear(iSelYear as Integer)
|
|
Dim lDate as Long
|
|
Select Case iSelYear
|
|
Case 1995
|
|
lDate = DateSerial(iSelYear, 1, 31)
|
|
Case 1996
|
|
lDate = DateSerial(iSelYear, 2, 19)
|
|
Case 1997
|
|
lDate = DateSerial(iSelYear, 2, 7)
|
|
Case 1998
|
|
lDate = DateSerial(iSelYear, 1, 28)
|
|
Case 1999
|
|
lDate = DateSerial(iSelYear,2, 16)
|
|
Case 2000
|
|
lDate = DateSerial(iSelYear,2, 5)
|
|
Case 2001
|
|
lDate = DateSerial(iSelYear, 1, 24)
|
|
Case 2002
|
|
lDate = DateSerial(iSelYear,2, 12)
|
|
Case 2003
|
|
lDate = DateSerial(iSelYear,2, 1)
|
|
Case 2004
|
|
lDate = DateSerial(iSelYear, 1, 22)
|
|
Case 2005
|
|
lDate = DateSerial(iSelYear,2, 9)
|
|
Case 2006
|
|
lDate = DateSerial(iSelYear, 1, 29)
|
|
Case 2007
|
|
lDate = DateSerial(iSelYear,2, 18)
|
|
Case 2008
|
|
lDate = DateSerial(iSelYear,2, 7)
|
|
Case 2009
|
|
lDate = DateSerial(iSelYear, 1, 26)
|
|
Case 2010
|
|
lDate = DateSerial(iSelYear,2, 10)
|
|
Case 2011
|
|
lDate = DateSerial(iSelYear,2, 3)
|
|
Case 2012
|
|
lDate = DateSerial(iSelYear, 1, 23)
|
|
Case 2013
|
|
lDate = DateSerial(iSelYear,2, 10)
|
|
Case 2014
|
|
lDate = DateSerial(iSelYear, 1, 31)
|
|
Case 2015
|
|
lDate = DateSerial(iSelYear,2, 19)
|
|
Case 2016
|
|
lDate = DateSerial(iSelYear,2, 9)
|
|
Case 2017
|
|
lDate = DateSerial(iSelYear, 1, 28)
|
|
Case 2018
|
|
lDate = DateSerial(iSelYear,2, 16)
|
|
Case 2019
|
|
lDate = DateSerial(iSelYear,2, 5)
|
|
Case 2020
|
|
lDate = DateSerial(iSelYear, 1, 25)
|
|
Case Else
|
|
Exit Sub
|
|
End Select
|
|
Select Case sCurCountryLocale
|
|
Case "CN"
|
|
CalInsertBankholiday(lDate-1, "农历除夕", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate, "春节初一", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate+1, "春节初二", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate+2, "春节初三", cHolidayType_Full)
|
|
|
|
Case Else
|
|
CalInsertBankholiday(lDate-1, "農曆除夕", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate, "春節初一", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate+1, "春節初二", cHolidayType_Full)
|
|
CalInsertBankholiday(lDate+2, "春節初三", cHolidayType_Full)
|
|
End Select
|
|
End Sub
|
|
|
|
|
|
Function CalculateJapaneseSpringDay(iSelYear as Integer)
|
|
If (iSelYear > 1979) And (iSelYear < 2100) Then
|
|
CalculateJapaneseSpringDay() = Int(20.8431 + 0.242194)* (iSelYear-1980) - (Int((iSelYear-1980)/4))
|
|
End If
|
|
End Function
|
|
|
|
|
|
Function CalculateJapaneseAutumnDay(iSelYear as Integer)
|
|
If (iSelYear > 1979) And (iSelYear < 2100) Then
|
|
CalculateJapaneseAutumnDay() = Int(23.8431 + 0.242194)* (iSelYear-1980) - (Int((iSelYear-1980)/4))
|
|
End If
|
|
End Function</script:module> |