From 619b8518ecc560633e0eba6f624e12bedb372fc0 Mon Sep 17 00:00:00 2001 From: Behrend Cornelius Date: Mon, 14 Oct 2002 15:16:58 +0000 Subject: #96771# several changes --- wizards/source/schedule/BankHoliday.xba | 10 ++++--- wizards/source/schedule/CalendarMain.xba | 43 +++++++++++++++++-------------- wizards/source/schedule/LocalHolidays.xba | 8 ++++-- 3 files changed, 35 insertions(+), 26 deletions(-) (limited to 'wizards/source') diff --git a/wizards/source/schedule/BankHoliday.xba b/wizards/source/schedule/BankHoliday.xba index 22fb465fe6be..eb90fc82a449 100644 --- a/wizards/source/schedule/BankHoliday.xba +++ b/wizards/source/schedule/BankHoliday.xba @@ -28,8 +28,11 @@ Dim B%,C%,D%,E%,F%,G%,H%,I%,K%,L%,M%,N%,O%, nMonth%, nDay% End Function +' Note: the following algorithm is valid only till the Year 2100. +' but I have no Idea from which date in the paste it is valid Function CalOrthodoxEasterTable(ByVal iYear as Integer) as Long Dim R1%, R2%, R3%, RA%, R4%, RB%, R5%, RC% +Dim lDate as Long R1 = iYear mod 19 R2 = iYear mod 4 R3 = iYear mod 7 @@ -38,7 +41,8 @@ Dim R1%, R2%, R3%, RA%, R4%, RB%, R5%, RC% RB = 2 * R2 + 4 * R3 + 6 * R4 R5 = RB mod 7 RC = R4 + R5 -' Todo: Add the result to March 22; + lDate = DateSerial(iYear, 4,4) + CalOrthodoxEasterTable() = lDate + RC End Function @@ -159,8 +163,6 @@ Dim lDate as Long End Function - - ' Finds the next weekday after a fixed date ' e.g. Midsummerfeast in Sweden: next Saturday after 20th June Function GetNextWeekDay(iYear as Integer, iMonth as Integer, iDay as Integer, iWeekDay as Integer) @@ -180,6 +182,6 @@ Sub AddFollowUpHolidays(ByVal lStartDate as Long, iCount as Integer, HolidayName Dim lDate as Long For lDate = lStartDate + 1 To lStartDate + 4 CalInsertBankholiday(lDate, HolidayName, iType) - Next i + Next lDate End Sub \ No newline at end of file diff --git a/wizards/source/schedule/CalendarMain.xba b/wizards/source/schedule/CalendarMain.xba index ac3dd997abaf..b2870aa28580 100644 --- a/wizards/source/schedule/CalendarMain.xba +++ b/wizards/source/schedule/CalendarMain.xba @@ -136,29 +136,32 @@ Sub SetupNumberFormatter(sCurLangLocale as String, sCurCountryLocale as String) Dim oFormats as Object Dim DateFormatString as String oFormats = oDocument.getNumberFormats() + Select Case sCurLangLocale - Case "en" - DateFormatString = "DD/MMM" - Case "pt" - Case "ru" - Case "nl" - Case "fr" - Case "es" - Case "it" - Case "da" - Case "sv" - Case "pl" - Case "de" + Case cLANGUAGE_GERMAN DateFormatString = "TT.MMM" - Case "tr" - Case "ja" - Case "zh" -' If sCurCountryLocale = "CN" Then + Case cLANGUAGE_ENGLISH + DateFormatString = "DD/MMM" + Case cLANGUAGE_FRENCH + Case cLANGUAGE_ITALIAN + Case cLANGUAGE_SPANISH + Case cLANGUAGE_PORTUGUESE + Case cLANGUAGE_DUTCH + Case cLANGUAGE_SWEDISH + Case cLANGUAGE_DANISH + Case cLANGUAGE_POLISH + Case cLANGUAGE_RUSSIAN + Case cLANGUAGE_JAPANESE + Case cLANGUAGE_CHINESE +' If sCurCountryLocale = "TW" Then ' Else -' End If - Case "ar" - Case "ko" - End Select +' End If + Case cLANGUAGE_GREEK + Case cLANGUAGE_TURKISH + Case cLANGUAGE_POLISH + Case cLANGUAGE_FINNISH + End Select + lDateFormat = AddNumberFormat(oFormats, DateFormatString, oDocument.CharLocale) lDateStandardFormat = oFormats.getStandardFormat(com.sun.star.util.NumberFormat.DATE, oDocument.CharLocale) diff --git a/wizards/source/schedule/LocalHolidays.xba b/wizards/source/schedule/LocalHolidays.xba index 62d91b135fc2..d5bb35ceacdd 100644 --- a/wizards/source/schedule/LocalHolidays.xba +++ b/wizards/source/schedule/LocalHolidays.xba @@ -45,6 +45,7 @@ Dim lDate& End Sub + Sub FindWholeYearHolidays_FI(ByVal YearInt as Integer) Dim OsternDate& ' New Year @@ -148,6 +149,7 @@ Dim lDate& End Sub + Sub FindWholeYearHolidays_TRK(ByVal YearInt as Integer) Dim lDate as Long ' New Years' Day @@ -168,6 +170,7 @@ Dim lDate as Long CalInsertBankholiday(DateSerial(YearInt, 10, 29), "Cumhuriyet Bayramı", cHolidayType_Full) ' Commemoration Of Ataturk-Anniversary of Ataturk's Death CalInsertBankholiday(DateSerial(YearInt, 11, 10), "Atatürk'ün Ölüm Günü", cHolidayType_Full) + CalculateturkishReligousHolidays(YearInt) End Sub @@ -181,7 +184,7 @@ Dim lRamazanBayRamStartDate as Long lRamazanBayRamStartDate = DateSerial(iSelYear, 12, 4) Case 2003 lKurbanBayRamStartDate = DateSerial(iSelYear, 2, 10) - lRamazanBayRamStartDate = DateSerial(iSelYear, 11, 14) + lRamazanBayRamStartDate = DateSerial(iSelYear, 11, 24) Case 2004 lKurbanBayRamStartDate = DateSerial(iSelYear, 1, 31) lRamazanBayRamStartDate = DateSerial(iSelYear, 11, 13) @@ -199,7 +202,7 @@ Dim lRamazanBayRamStartDate as Long lKurbanBayRamStartDate = DateSerial(iSelYear, 1, 1) ' Note: The first day has already been in 2006!!! AddFollowUpHolidays(lKurbanBayRamStartDate-1, 3, "Kurban Bayram", cHolidayType_Full) - lKurbanBayRamStartDate = DateSerial(iSelYear, 12, 20) + lKurbanBayRamStartDate = DateSerial(iSelYear, 12, 19) lRamazanBayRamStartDate = DateSerial(iSelYear, 10, 11) Case 2008 @@ -273,6 +276,7 @@ Dim lDate as Long End Sub + Sub FindWholeYearHolidays_SPAIN(ByVal YearInt as Integer) Dim lDate& CalInsertBankholiday(DateSerial(YearInt, 1, 1), "Año Nuevo", cHolidayType_Full) -- cgit