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() +' sCurLanguage = "ja" With DlgCalModel .cmdDelete.Enabled = False .lstMonth.StringItemList() = cCalShortMonthNames() @@ -129,7 +130,6 @@ End Sub Sub CalcmdCancel() Call CalSaveOwnData() -' bCancelTask = True DlgCalendar.EndExecute 'Visible = False End Sub @@ -147,7 +147,7 @@ Dim SelYear as String UnprotectSheets(oSheets) oSheets.RemovebyName(oSheets.GetbyIndex(0).Name) iSelYear = DlgCalModel.txtYear.Value -' sCurLangLocale = "zh" +' sCurLangLocale = "ja" ' sCurCountryLocale = "TW" 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 @@ - + 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 ' Abreviated months start 1225 Const dlgShortMonth = 1225 + DlgCalendar.GetControl("lblHolidays").Visible = LangLocale = cLANGUAGE_GERMAN + DlgCalendar.GetControl("lstHolidays").Visible = LangLocale = cLANGUAGE_GERMAN If InitResources("schedule", "cal") Then If LangLocale = cLANGUAGE_GERMAN Then - DlgCalendar.GetControl("lblHolidays").Visible = True - DlgCalendar.GetControl("lstHolidays").Visible = True ' 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& 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, 21), "春分の日", 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) @@ -375,6 +374,7 @@ 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) @@ -391,4 +391,82 @@ Sub FindWholeYearHolidays_TW(YearInt as Integer) CalInsertBankholiday(DateSerial(YearInt, 10, 31), "先總統 蔣公誕辰紀念日", cHolidayType_Half) CalInsertBankholiday(DateSerial(YearInt, 12, 11), "國父誕辰紀念日(中華文化復興節)", cHolidayType_Half) CalInsertBankholiday(DateSerial(YearInt, 12, 25), "行憲紀念日", cHolidayType_Half) -End Sub \ 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, "農曆除夕", cHolidayType_Full) + CalInsertBankholiday(lDate, "道教節", cHolidayType_Full) + CalInsertBankholiday(lDate+1, "春節", cHolidayType_Full) +End Sub + + +' Todo: Was passiert mit den Jahren vor 1980? +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 + \ No newline at end of file