summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--wizards/source/schedule/BankHoliday.xba10
-rw-r--r--wizards/source/schedule/CalendarMain.xba43
-rw-r--r--wizards/source/schedule/LocalHolidays.xba8
3 files changed, 35 insertions, 26 deletions
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
</script:module> \ 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 &quot;en&quot;
- DateFormatString = &quot;DD/MMM&quot;
- Case &quot;pt&quot;
- Case &quot;ru&quot;
- Case &quot;nl&quot;
- Case &quot;fr&quot;
- Case &quot;es&quot;
- Case &quot;it&quot;
- Case &quot;da&quot;
- Case &quot;sv&quot;
- Case &quot;pl&quot;
- Case &quot;de&quot;
+ Case cLANGUAGE_GERMAN
DateFormatString = &quot;TT.MMM&quot;
- Case &quot;tr&quot;
- Case &quot;ja&quot;
- Case &quot;zh&quot;
-&apos; If sCurCountryLocale = &quot;CN&quot; Then
+ Case cLANGUAGE_ENGLISH
+ DateFormatString = &quot;DD/MMM&quot;
+ 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
+&apos; If sCurCountryLocale = &quot;TW&quot; Then
&apos; Else
-&apos; End If
- Case &quot;ar&quot;
- Case &quot;ko&quot;
- End Select
+&apos; 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&amp;
End Sub
+
Sub FindWholeYearHolidays_FI(ByVal YearInt as Integer)
Dim OsternDate&amp;
&apos; New Year
@@ -148,6 +149,7 @@ Dim lDate&amp;
End Sub
+
Sub FindWholeYearHolidays_TRK(ByVal YearInt as Integer)
Dim lDate as Long
&apos; New Years&apos; Day
@@ -168,6 +170,7 @@ Dim lDate as Long
CalInsertBankholiday(DateSerial(YearInt, 10, 29), &quot;Cumhuriyet Bayramı&quot;, cHolidayType_Full)
&apos; Commemoration Of Ataturk-Anniversary of Ataturk&apos;s Death
CalInsertBankholiday(DateSerial(YearInt, 11, 10), &quot;Atatürk&apos;ün Ölüm Günü&quot;, 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)
&apos; Note: The first day has already been in 2006!!!
AddFollowUpHolidays(lKurbanBayRamStartDate-1, 3, &quot;Kurban Bayram&quot;, 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&amp;
CalInsertBankholiday(DateSerial(YearInt, 1, 1), &quot;Año Nuevo&quot;, cHolidayType_Full)