home *** CD-ROM | disk | FTP | other *** search
- <?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="HolidayUSA" script:language="StarBasic">Option Explicit
-
- Sub Main
- Call CalAutopilotTable()
- End Sub
-
- Sub FindWholeYearHolidays_US(ByVal YearInt%)
-
- Dim lDate&
- Dim Easter$
-
- CalInsertBankholiday(DateSerial(YearInt%, 1, 1), "New Year's Day", cHolidayType_Full)
- CalInsertBankholiday(DateSerial(YearInt%, 1, 17), "Martin Luther King", cHolidayType_Full)
-
- CalInsertBankholiday(DateSerial(YearInt%, 2, 12), "Lincoln's Birthday", cHolidayType_Half)
- CalInsertBankholiday(DateSerial(YearInt%, 2, 14), "Valentine's Day", cHolidayType_Half)
- CalInsertBankholiday(DateSerial(YearInt%, 2, 21), "President's Day", cHolidayType_Full)
- CalInsertBankholiday(DateSerial(YearInt%, 2, 22), "Washington's Birthday", cHolidayType_Half)
-
-
- ' Last Monday in May: Menorial Day, Full
- lDate& = DateSerial(YearInt%, 6, 1) - 1
- While WeekDay(lDate&) <> 2
- lDate& = lDate& - 1
- Wend
- CalInsertBankholiday(lDate&, "Memorial Day", cHolidayType_Full)
-
- ' Mothers Day : 2nd Sunday in May, Full
- lDate = GetMonthDate(1,5,2)
- CalInsertBankholiday(lDate&, "Mother's Day", cHolidayType_Full)
-
- ' Fathers Day : 3rd Sunday in June
- lDate = GetMonthDate(1,6,3)
- CalInsertBankholiday(lDate&, "Father's Day", cHolidayType_Full)
-
- ' Easter, get it with look-up table
- lDate& = CalEasterTable&(YearInt%)
- CalInsertBankholiday(lDate&, "Easter Sunday", cHolidayType_Full)
-
- CalInsertBankholiday(DateSerial(YearInt%, 7, 4), "Independence Day", cHolidayType_Full)
-
- CalInsertBankholiday(DateSerial(YearInt%, 10, 9), "Columbus Day", cHolidayType_Half)
- CalInsertBankholiday(DateSerial(YearInt%, 10, 31), "Halloween", cHolidayType_Half)
-
- ' 1st Monday in Sep : Labor Day, Full
- lDate = GetMonthDate(2,9,1)
- CalInsertBankholiday(lDate&, "Labor Day", cHolidayType_Full)
-
- ' First Thursday in November
- lDate = GetMonthDate(3, 11, 1)
- CalInsertBankholiday(lDate&, "Election Day", cHolidayType_Full)
-
- ' 3rd Thu in Nov : Thanksgiving, Full
- lDate = GetMonthDate(5, 11, 1)
- lDate& = lDate& + 21
- CalInsertBankholiday(lDate&, "Thanksgiving", cHolidayType_Full)
-
- CalInsertBankholiday(DateSerial(YearInt%, 11, 11), "Veteran's 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)
- End Sub</script:module>