#94767# Routine for japanese spring festival and taiwanese new year added
This commit is contained in:
parent
8b0f526823
commit
cef0eccd7e
4 changed files with 86 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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"/>
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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</script:module>
|
||||
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
|
||||
</script:module>
|
Loading…
Reference in a new issue