summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehrend Cornelius <bc@openoffice.org>2001-11-22 08:37:42 +0000
committerBehrend Cornelius <bc@openoffice.org>2001-11-22 08:37:42 +0000
commitcef0eccd7eef8bdb1080b29c9fecbe63c2288a49 (patch)
tree1a21720cf59fd120a04793f37784b2f953bbfe5a
parent8b0f52682323b70713f372bb217a089fb474c820 (diff)
#94767# Routine for japanese spring festival and taiwanese new year added
-rw-r--r--wizards/source/schedule/CalendarMain.xba4
-rw-r--r--wizards/source/schedule/DlgCalendar.xdl2
-rw-r--r--wizards/source/schedule/Language.xba4
-rw-r--r--wizards/source/schedule/LocalHolidays.xba84
4 files changed, 86 insertions, 8 deletions
diff --git a/wizards/source/schedule/CalendarMain.xba b/wizards/source/schedule/CalendarMain.xba
index 798d8cf4cc5a..d256379f1010 100644
--- a/wizards/source/schedule/CalendarMain.xba
+++ b/wizards/source/schedule/CalendarMain.xba
@@ -84,6 +84,7 @@ Dim iThisMonth as Integer
CalChoosenLand = -2
CurOwnMonth = -1
CalLoadOwnData()
+&apos; sCurLanguage = &quot;ja&quot;
With DlgCalModel
.cmdDelete.Enabled = False
.lstMonth.StringItemList() = cCalShortMonthNames()
@@ -129,7 +130,6 @@ End Sub
Sub CalcmdCancel()
Call CalSaveOwnData()
-&apos; bCancelTask = True
DlgCalendar.EndExecute &apos;Visible = False
End Sub
@@ -147,7 +147,7 @@ Dim SelYear as String
UnprotectSheets(oSheets)
oSheets.RemovebyName(oSheets.GetbyIndex(0).Name)
iSelYear = DlgCalModel.txtYear.Value
-&apos; sCurLangLocale = &quot;zh&quot;
+&apos; sCurLangLocale = &quot;ja&quot;
&apos; sCurCountryLocale = &quot;TW&quot;
Select Case sCurLangLocale
Case cLANGUAGE_GERMAN
diff --git a/wizards/source/schedule/DlgCalendar.xdl b/wizards/source/schedule/DlgCalendar.xdl
index fe40453f8ae4..70c9cca9a535 100644
--- a/wizards/source/schedule/DlgCalendar.xdl
+++ b/wizards/source/schedule/DlgCalendar.xdl
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
-<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="Dialog1" dlg:left="160" dlg:top="81" dlg:width="208" dlg:height="156" dlg:page="2" dlg:help-url="HID:34700">
+<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="Dialog1" dlg:left="160" dlg:top="81" dlg:width="208" dlg:height="156" dlg:page="1" dlg:help-url="HID:34700">
<dlg:styles>
<dlg:style dlg:style-id="0" dlg:background-color="0x8000"/>
<dlg:style dlg:style-id="1" dlg:font-name="Cumberland" dlg:font-stylename="Standard" dlg:font-family="modern" dlg:font-charset="ansi"/>
diff --git a/wizards/source/schedule/Language.xba b/wizards/source/schedule/Language.xba
index cc650dd87ca5..379749081899 100644
--- a/wizards/source/schedule/Language.xba
+++ b/wizards/source/schedule/Language.xba
@@ -23,11 +23,11 @@ Dim i as Integer
Const dlgMonth = 1200
&apos; Abreviated months start 1225
Const dlgShortMonth = 1225
+ DlgCalendar.GetControl(&quot;lblHolidays&quot;).Visible = LangLocale = cLANGUAGE_GERMAN
+ DlgCalendar.GetControl(&quot;lstHolidays&quot;).Visible = LangLocale = cLANGUAGE_GERMAN
If InitResources(&quot;schedule&quot;, &quot;cal&quot;) Then
If LangLocale = cLANGUAGE_GERMAN Then
- DlgCalendar.GetControl(&quot;lblHolidays&quot;).Visible = True
- DlgCalendar.GetControl(&quot;lstHolidays&quot;).Visible = True
&apos; Load all states
BLNameList(0) = GetResText(1100)
diff --git a/wizards/source/schedule/LocalHolidays.xba b/wizards/source/schedule/LocalHolidays.xba
index 84afd458c5d9..d3eee53d4d56 100644
--- a/wizards/source/schedule/LocalHolidays.xba
+++ b/wizards/source/schedule/LocalHolidays.xba
@@ -350,11 +350,10 @@ End Sub
Sub FindWholeYearHolidays_JP(ByVal YearInt as Integer)
Dim lDate&amp;
CalInsertBankholiday(DateSerial(YearInt, 1, 1), &quot;元日&quot;, cHolidayType_Full)
-
&apos; 2nd Monday in January
CalInsertBankholiday(GetMonthDate(YearInt, 1, 2, 7), &quot;成人の日&quot;, cHolidayType_Full)
CalInsertBankholiday(DateSerial(YearInt, 2, 11), &quot;建国記念の日&quot;, cHolidayType_Full)
- CalInsertBankholiday(DateSerial(YearInt, 3, 21), &quot;春分の日&quot;, cHolidayType_Full)
+ CalInsertBankholiday(DateSerial(YearInt, 3, 20), &quot;春分の日&quot;, cHolidayType_Full)
CalInsertBankholiday(DateSerial(YearInt, 4, 29), &quot;みどりの日&quot;, cHolidayType_Full)
CalInsertBankholiday(DateSerial(YearInt, 5, 3), &quot;憲法記念日&quot;, cHolidayType_Full)
CalInsertBankholiday(DateSerial(YearInt, 5, 4), &quot;国民の休日&quot;, cHolidayType_Full)
@@ -375,6 +374,7 @@ End Sub
Sub FindWholeYearHolidays_TW(YearInt as Integer)
+ CalculateChineseNewYear(YearInt)
CalInsertBankholiday(DateSerial(YearInt, 2, 28), &quot;和平紀念日&quot;, cHolidayType_Full)
CalInsertBankholiday(DateSerial(YearInt, 3, 8), &quot;婦女節&quot;, cHolidayType_Half)
CalInsertBankholiday(DateSerial(YearInt, 3, 29), &quot;革命先烈紀念日(青年節)&quot;, cHolidayType_Half)
@@ -391,4 +391,82 @@ Sub FindWholeYearHolidays_TW(YearInt as Integer)
CalInsertBankholiday(DateSerial(YearInt, 10, 31), &quot;先總統 蔣公誕辰紀念日&quot;, cHolidayType_Half)
CalInsertBankholiday(DateSerial(YearInt, 12, 11), &quot;國父誕辰紀念日(中華文化復興節)&quot;, cHolidayType_Half)
CalInsertBankholiday(DateSerial(YearInt, 12, 25), &quot;行憲紀念日&quot;, cHolidayType_Half)
-End Sub</script:module> \ No newline at end of file
+End Sub
+
+
+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)
+ End Select
+ CalInsertBankholiday(lDate-1, &quot;農曆除夕&quot;, cHolidayType_Full)
+ CalInsertBankholiday(lDate, &quot;道教節&quot;, cHolidayType_Full)
+ CalInsertBankholiday(lDate+1, &quot;春節&quot;, cHolidayType_Full)
+End Sub
+
+
+&apos; Todo: Was passiert mit den Jahren vor 1980?
+Function CalculateJapaneseSpringDay(iSelYear as Integer)
+ If (iSelYear &gt; 1979) And (iSelYear &lt; 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 &gt; 1979) And (iSelYear &lt; 2100) Then
+ CalculateJapaneseAutumnDay() = Int(23.8431 + 0.242194)* (iSelYear-1980) - (Int((iSelYear-1980)/4))
+ End If
+End Function
+</script:module> \ No newline at end of file