Kaydet (Commit) 2fa20cf9 authored tarafından Behrend Cornelius's avatar Behrend Cornelius

#96771# Own Holidays that occur once no longer supported

üst e03422fa
...@@ -124,30 +124,23 @@ End Function ...@@ -124,30 +124,23 @@ End Function
Sub CalInsertOwnDataInTables(ByVal iSelYear as Integer) Sub CalInsertOwnDataInTables(ByVal iSelYear as Integer)
' Fügt die eigenen Individuellen Daten aus der Tabelle in die ' inserts the individual data from the table into the previously unsorted list
' bereits erstellte unsortierte Tabelle ein.
Dim CurEventName as String Dim CurEventName as String
Dim CurYear as Integer Dim CurEvMonth as Integer
Dim CurMonth as Integer Dim CurEvDay as Integer
Dim CurDay as Integer
Dim LastIndex as Integer Dim LastIndex as Integer
Dim i as Integer Dim i as Integer
Dim DateStr as String
LastIndex = Ubound(DlgCalModel.lstOwnData.StringItemList()) LastIndex = Ubound(DlgCalModel.lstOwnData.StringItemList())
For i = 0 To LastIndex For i = 0 To LastIndex
CurYear = CalGetYearOfEvent(i) If GetSelectedDateUnits(CurEvDay, CurEvMonth, i) <> SBDATEUNDEFINED Then
If DlgCalModel.lstOwnData.StringItemList(i) <> "" Then CurEventName = CalGetNameOfEvent(i)
If (CurYear = iSelYear) Or (CurYear = 0) Then CalInsertBankholiday(DateSerial(iSelYear, CurEvMonth, CurEvDay), CurEventName, cHolidayType_Own)
CurMonth = CalGetMonthofEvent(i)
CurDay = CalGetDayofEvent(i)
CurEventName = CalGetNameOfEvent(i)
CalInsertBankholiday(DateSerial(CurYear, CurMonth, CurDay), CurEventName, cHolidayType_Own)
End If
End If End If
Next Next
End Sub End Sub
' Finds eg the first,second Monday in a month ' Finds eg the first,second Monday in a month
' Note: in This Function the week starts with the Sunday ' Note: in This Function the week starts with the Sunday
Function GetMonthDate(YearInt as Integer, iMonth as Integer, iWeekDay as Integer, iOffset as Integer) Function GetMonthDate(YearInt as Integer, iMonth as Integer, iWeekDay as Integer, iOffset as Integer)
...@@ -167,7 +160,6 @@ Dim lDate as Long ...@@ -167,7 +160,6 @@ Dim lDate as Long
End Function End Function
' Finds the next weekday after a fixed date ' Finds the next weekday after a fixed date
' e.g. Midsummerfeast in Sweden: next Saturday after 20th June ' e.g. Midsummerfeast in Sweden: next Saturday after 20th June
Function GetNextWeekDay(iYear as Integer, iMonth as Integer, iDay as Integer, iWeekDay as Integer) Function GetNextWeekDay(iYear as Integer, iMonth as Integer, iDay as Integer, iWeekDay as Integer)
...@@ -185,7 +177,7 @@ End Function ...@@ -185,7 +177,7 @@ End Function
Sub AddFollowUpHolidays(ByVal lStartDate as Long, iCount as Integer, HolidayName as String, iType as Integer) Sub AddFollowUpHolidays(ByVal lStartDate as Long, iCount as Integer, HolidayName as String, iType as Integer)
Dim lDate as Long Dim lDate as Long
For lDate = lStartDate + 1 To lStartDate + iCount For lDate = lStartDate + 1 To lStartDate + 4
CalInsertBankholiday(lDate, HolidayName, iType) CalInsertBankholiday(lDate, HolidayName, iType)
Next lDate Next lDate
End Sub End Sub
......
...@@ -61,6 +61,8 @@ Public CONST CalBLThueringen = 16 ...@@ -61,6 +61,8 @@ Public CONST CalBLThueringen = 16
Public DlgCalendar as Object Public DlgCalendar as Object
Public DlgCalModel as Object Public DlgCalModel as Object
Public lDateFormat as Long
Public lDateStandardFormat as Long
...@@ -85,15 +87,14 @@ Dim iThisMonth as Integer ...@@ -85,15 +87,14 @@ Dim iThisMonth as Integer
CalChoosenLand = -2 CalChoosenLand = -2
CalLoadOwnData() CalLoadOwnData()
' sCurLanguage = "ja"
With DlgCalModel With DlgCalModel
.cmdDelete.Enabled = False .cmdDelete.Enabled = False
.lstMonth.StringItemList() = cCalShortMonthNames() .lstMonth.StringItemList() = cCalShortMonthNames()
Select Case sCurLangLocale Select Case sCurLangLocale
Case "ja" Case cLANGUAGE_JAPANESE
.lstOwnData.FontName = "HG Mincho Light J" .lstOwnData.FontName = "HG Mincho Light J"
.txtEvent.FontName = "HG Mincho Light J" .txtEvent.FontName = "HG Mincho Light J"
Case "zh" Case cLANGUAGE_CHINESE
If oDocument.CharLocale.Country = "CN" Then If oDocument.CharLocale.Country = "CN" Then
.lstOwnData.FontName = "HG MSung Light SC" .lstOwnData.FontName = "HG MSung Light SC"
.txtEvent.FontName = "HG MSung Light SC" .txtEvent.FontName = "HG MSung Light SC"
...@@ -111,6 +112,7 @@ Dim iThisMonth as Integer ...@@ -111,6 +112,7 @@ Dim iThisMonth as Integer
.txtYear.Tag = .txtYear.Value .txtYear.Tag = .txtYear.Value
.Step = 1 .Step = 1
End With End With
SetupNumberFormatter(sCurLangLocale, sCurCountryLocale)
CalChooseCalendar() ' month CalChooseCalendar() ' month
iThisMonth = Month(Now) iThisMonth = Month(Now)
DlgCalendar.GetControl("lstMonth").SelectItemPos(iThisMonth-1, True) DlgCalendar.GetControl("lstMonth").SelectItemPos(iThisMonth-1, True)
...@@ -129,6 +131,70 @@ ErrorHandler: ...@@ -129,6 +131,70 @@ ErrorHandler:
End Sub End Sub
Sub SetupNumberFormatter(sCurLangLocale as String, sCurCountryLocale as String)
Dim oFormats as Object
Dim DateFormatString as String
oFormats = oDocument.getNumberFormats()
Select Case sCurLangLocale
Case cLANGUAGE_GERMAN
DateFormatString = "TT.MMM"
Case cLANGUAGE_ENGLISH
DateFormatString = "MMM DD"
Case cLANGUAGE_FRENCH
DateFormatString = "JJ/MMM"
Case cLANGUAGE_ITALIAN
DateFormatString = "GG/MMM"
Case cLANGUAGE_SPANISH
DateFormatString = "DD/MMM"
Case cLANGUAGE_PORTUGUESE
DateFormatString = "DD-MMM"
Case cLANGUAGE_DUTCH
DateFormatString = "DD-MMM"
Case cLANGUAGE_SWEDISH
DateFormatString = "MMM DD"
Case cLANGUAGE_DANISH
DateFormatString = "DD-MMM"
Case cLANGUAGE_POLISH
DateFormatString = "MMM DD"
Case cLANGUAGE_RUSSIAN
DateFormatString = "MMM DD"
Case cLANGUAGE_JAPANESE
DateFormatString = "M月D日"
Case cLANGUAGE_CHINESE
If sCurCountryLocale = "TW" Then
DateFormatString = "MMMMD" &"""" & "" & """"
Else
DateFormatString = "M" & """" & "" & """" & "D" &"""" & "" & """"
End If
Case cLANGUAGE_GREEK
DateFormatString = "DD/MMM"
Case cLANGUAGE_TURKISH
DateFormatString = "DD/MMM"
Case cLANGUAGE_POLISH
DateFormatString = "MMM DD"
Case cLANGUAGE_FINNISH
DateFormatString = "PP.KKK"
End Select
lDateFormat = AddNumberFormat(oFormats, DateFormatString, oDocument.CharLocale)
lDateStandardFormat = oFormats.getStandardFormat(com.sun.star.util.NumberFormat.DATE, oDocument.CharLocale)
' lDateStandardFormat = AddNumberFormat(oFormats, StandardDateFormatString, oDocument.CharLocale)
oNumberFormatter = createUNOService("com.sun.star.util.NumberFormatter")
oNumberFormatter.attachNumberFormatsSupplier(oDocument)
End Sub
Function AddNumberFormat(oNumberFormats as Object, FormatString as String, oLocale as Object) as Long
Dim lLocDateFormat as Long
lLocDateFormat = oNumberFormats.QueryKey(FormatString, oLocale, True)
If lLocDateFormat = -1 Then
lLocDateFormat = oNumberFormats.addNew(FormatString, oLocale)
End If
AddNumberFormat() = lLocDateFormat
End Function
Sub CalChooseCalendar() Sub CalChooseCalendar()
With DlgCalModel With DlgCalModel
.lstMonth.Enabled = .optMonth.State = 1 .lstMonth.Enabled = .optMonth.State = 1
...@@ -143,52 +209,18 @@ Sub CalcmdCancel() ...@@ -143,52 +209,18 @@ Sub CalcmdCancel()
End Sub End Sub
Sub CalcmdOk() Sub CalcmdOk()
' cmdOk is called when the Button 'Read' is clicked on ' cmdOk is called when the Button 'Read' is clicked on
' It is either given out a month or a year ' It is either given out a month or a year
Dim i as Integer Dim i, iSelYear as Integer
Dim iSelYear as Integer
Dim SelYear as String Dim SelYear as String
' DlgCalendar.Visible = False
oSheets = oDocument.sheets oSheets = oDocument.sheets
Call CalSaveOwnData() Call CalSaveOwnData()
UnprotectSheets(oSheets) UnprotectSheets(oSheets)
oSheets.RemovebyName(oSheets.GetbyIndex(0).Name) oSheets.RemovebyName(oSheets.GetbyIndex(0).Name)
iSelYear = DlgCalModel.txtYear.Value iSelYear = DlgCalModel.txtYear.Value
If DlgCalModel.optYear.State = 1 Then
oSheets.RemovebyName(oSheets.GetbyIndex(0).Name)
oSheet = oSheets.GetbyIndex(0)
oSheet.Name = sCalendarTitle$ + " " + iSelYear
InsertLocalBankholidays(iSelYear)
CalInsertOwnDataInTables(iSelYear)
oDocument.AddActionLock()
CalCreateYearTable(iSelYear)
ElseIf DlgCalModel.optMonth.State = 1 Then
Dim iMonth
iMonth = DlgCalModel.lstMonth.SelectedItems(0) + 1
oSheets.RemovebyName(oSheets.GetbyIndex(1).Name)
oSheet = oSheets.GetbyIndex(0)
If sMonthTitle = "" Then
oSheet.Name = cCalLongMonthNames(iMonth-1)
Else
oSheet.Name = sMonthTitle + " " + cCalLongMonthNames(iMonth-1)
End If
InsertLocalBankholidays(iSelYear)
CalInsertOwnDataInTables(iSelYear)
oDocument.AddActionLock
CalCreateMonthTable(iSelYear, iMonth)
End If
oDocument.RemoveActionLock
' oDocument.CalculateAll()
oSheet.protect("")
oStatusLine.End
DlgCalendar.EndExecute()
bCancelTask = True
End Sub
Sub InsertLocalBankholidays(iSelYear as Integer)
Select Case sCurLangLocale Select Case sCurLangLocale
Case cLANGUAGE_GERMAN Case cLANGUAGE_GERMAN
If Ubound(DlgCalModel.lstHolidays.SelectedItems()) > -1 Then If Ubound(DlgCalModel.lstHolidays.SelectedItems()) > -1 Then
...@@ -234,4 +266,33 @@ Sub InsertLocalBankholidays(iSelYear as Integer) ...@@ -234,4 +266,33 @@ Sub InsertLocalBankholidays(iSelYear as Integer)
Case cLANGUAGE_FINNISH Case cLANGUAGE_FINNISH
Call FindWholeYearHolidays_FI(iSelYear) Call FindWholeYearHolidays_FI(iSelYear)
End Select End Select
End Sub</script:module>
\ No newline at end of file Call CalInsertOwnDataInTables(iSelYear)
If DlgCalModel.optYear.State = 1 Then
oSheets.RemovebyName(oSheets.GetbyIndex(0).Name)
oSheet = oSheets.GetbyIndex(0)
oSheet.Name = sCalendarTitle$ + &quot; &quot; + iSelYear
oDocument.AddActionLock
Call CalCreateYearTable(iSelYear)
ElseIf DlgCalModel.optMonth.State = 1 Then
Dim iMonth
iMonth = DlgCalModel.lstMonth.SelectedItems(0) + 1
oSheets.RemovebyName(oSheets.GetbyIndex(1).Name)
oSheet = oSheets.GetbyIndex(0)
If sMonthTitle = &quot;&quot; Then
oSheet.Name = cCalLongMonthNames(iMonth-1)
Else
oSheet.Name = sMonthTitle + &quot; &quot; + cCalLongMonthNames(iMonth-1)
End If
oDocument.AddActionLock
Call CalCreateMonthTable(iSelYear, iMonth)
End If
oDocument.RemoveActionLock
oSheet.protect(&quot;&quot;)
oStatusLine.End
DlgCalendar.EndExecute()
bCancelTask = True
End Sub
</script:module>
\ No newline at end of file
...@@ -114,6 +114,7 @@ ErrorHandling: ...@@ -114,6 +114,7 @@ ErrorHandling:
End Sub End Sub
Sub FormatCalCells(ColPos,RowPos,i as Integer) Sub FormatCalCells(ColPos,RowPos,i as Integer)
Dim oNameCell, oDateCell as Object Dim oNameCell, oDateCell as Object
Dim iCellValue as Long Dim iCellValue as Long
......
...@@ -8,6 +8,7 @@ Public fHeightCorrFactor as Double ...@@ -8,6 +8,7 @@ Public fHeightCorrFactor as Double
Public fWidthCorrFactor as Double Public fWidthCorrFactor as Double
Sub Main() Sub Main()
Call CalAutopilotTable() Call CalAutopilotTable()
End Sub End Sub
...@@ -15,14 +16,28 @@ End Sub ...@@ -15,14 +16,28 @@ End Sub
Sub CalcmdDeleteSelect() Sub CalcmdDeleteSelect()
Dim MsgBoxResult as Integer Dim MsgBoxResult as Integer
Dim bDoEnable as Boolean
Dim iSel as Integer
Dim MaxIndex as Integer
If Ubound(DlgCalModel.lstOwnData.SelectedItems()) &gt; -1 Then If Ubound(DlgCalModel.lstOwnData.SelectedItems()) &gt; -1 Then
MsgBoxResult = MsgBox(cCalSubcmdDeleteSelect_DeleteSelEntry$, 4+32, cCalSubcmdDeleteSelect_DeleteSelEntryTitle$) MsgBoxResult = MsgBox(cCalSubcmdDeleteSelect_DeleteSelEntry$, 4+32, cCalSubcmdDeleteSelect_DeleteSelEntryTitle$)
If MsgBoxResult = 6 Then If MsgBoxResult = 6 Then
iSel = DlgCalModel.lstOwnData.SelectedItems(0)
DlgCalModel.lstOwnData.StringItemList() = RemoveSelected(DlgCalModel.lstOwnData) DlgCalModel.lstOwnData.StringItemList() = RemoveSelected(DlgCalModel.lstOwnData)
&apos; Flag zum Speichern der neuen Daten. &apos; Flag to store the new data
bCalOwnDataChanged = True bCalOwnDataChanged = True
DlgCalModel.cmdDelete.Enabled = Ubound(DlgCalModel.lstOwnData.StringItemList()) &gt; -1 bDoEnable = Ubound(DlgCalModel.lstOwnData.StringItemList()) &gt; -1
Call CalClearInputMask() DlgCalModel.cmdDelete.Enabled = bDoEnable
If bDoEnable Then
MaxIndex = Ubound(DlgCalModel.lstOwnData.StringItemList())
If iSel &gt; MaxIndex Then
iSel = MaxIndex
End If
DlgCalendar.GetControl(&quot;lstOwnData&quot;).SelectItemPos(iSel, True)
CalUpdateNewEventFrame()
Else
Call CalClearInputMask()
End If
End If End If
End If End If
End Sub End Sub
...@@ -32,21 +47,6 @@ Sub CalSaveOwnEventControls() ...@@ -32,21 +47,6 @@ Sub CalSaveOwnEventControls()
With DlgCalModel With DlgCalModel
.txtOwnEventDay.Tag = .txtOwnEventDay.Value .txtOwnEventDay.Tag = .txtOwnEventDay.Value
.txtOwnEventMonth.Tag = .txtOwnEventMonth.Text .txtOwnEventMonth.Tag = .txtOwnEventMonth.Text
.DlgCalModel.txtOwnEventYear.Tag = DlgCalModel.txtOwnEventYear.Value
End With
End Sub
Sub ToggleYearBox()
&apos; Falls der RadioButton für einen Jahreskalender angeklickt
&apos; worden ist, müssen die Controls für den Monat Disabled
&apos; werden, da ihre Werte in einer Jahrestabelle aufgehen.
With DlgCalModel
.txtOwnEventYear.Enabled = .chkEventOnce.State = 1
.lblEventYear.Enabled = .chkEventOnce.State = 1
If .txtOwnEventYear.Value = 0 And .lblEventYear.Enabled Then
.txtOwnEventYear.Value = Year(Now)
End If
End With End With
End Sub End Sub
...@@ -66,11 +66,14 @@ End Sub ...@@ -66,11 +66,14 @@ End Sub
Sub SelectState(aEvent as Object) Sub SelectState(aEvent as Object)
Dim ListIndex as Integer Dim ListIndex as Integer
If aEvent.ClickCount &gt;= 1 Then Select Case sCurLangLocale
ListIndex = CalGetGermanLandAtMousePos(CInt(aEvent.X/fWidthCorrFactor), CInt(aEvent.Y/fHeightCorrFactor), Land$) Case cLANGUAGE_GERMAN
DlgCalendar.GetControl(&quot;lstHolidays&quot;).SelectItemPos(ListIndex, True) If aEvent.ClickCount &gt;= 1 Then
bSelectByMouseMove = False ListIndex = CalGetGermanLandAtMousePos(CInt(aEvent.X/fWidthCorrFactor), CInt(aEvent.Y/fHeightCorrFactor), Land$)
End If DlgCalendar.GetControl(&quot;lstHolidays&quot;).SelectItemPos(ListIndex, True)
bSelectByMouseMove = False
End If
End Select
End Sub End Sub
...@@ -81,29 +84,26 @@ End Sub ...@@ -81,29 +84,26 @@ End Sub
Sub CalClearInputMask() Sub CalClearInputMask()
Dim NullList() as String Dim NullList() as String
&apos; Löscht die Werte der Eingabe Controls für ein neues Ereignis.
With DlgCalModel With DlgCalModel
.chkEventOnce.State = 0
.lblEventYear.Enabled = False
.txtOwnEventYear.Enabled = False
.txtOwnEventYear.SetPropertyToDefault(&quot;Value&quot;)
.txtEvent.Text = &quot;&quot; .txtEvent.Text = &quot;&quot;
.txtOwnEventDay.SetPropertyToDefault(&quot;Value&quot;) .txtOwnEventDay.SetPropertyToDefault(&quot;Value&quot;)
.cmdInsert.Enabled = False .cmdInsert.Enabled = False
End With End With
DlgCalendar.GetControl(&quot;lstOwnEventMonth&quot;).SelectItemPos(0,True) If Ubound(DlgCalModel.lstOwnData.StringItemList()) &gt; -1 Then
CurOwnMonth = 1 If Ubound(DlgCalModel.lstOwnData.SelectedItems()) = -1 Then
DlgCalendar.GetControl(&quot;lstOwnData&quot;).SelectItemPos(0,True)
CalUpdateNewEventFrame()
End If
End If
End Sub End Sub
Sub CalmdSwitchOwnDataOrGeneral() Sub CalmdSwitchOwnDataOrGeneral()
&apos;Ändert den Titel der Dialogbox beim Seitenwechsel und die
&apos;Beschriftungen der Knöpfe
If DlgCalModel.Step = 1 Then If DlgCalModel.Step = 1 Then
DlgCalModel.Step = 2 DlgCalModel.Step = 2
DlgCalModel.cmdOwnData.Label = cCalSubcmdSwitchOwnDataOrGeneral_Back$ DlgCalModel.cmdOwnData.Label = cCalSubcmdSwitchOwnDataOrGeneral_Back$
DlgCalModel.cmdInsert.Enabled = DlgCalModel.txtEvent.Text &lt;&gt; &quot;&quot; DlgCalModel.cmdInsert.Enabled = DlgCalModel.txtEvent.Text &lt;&gt; &quot;&quot;
ToggleYearBox() &apos; ToggleYearBox()
Else Else
dim bla as boolean dim bla as boolean
DlgCalModel.Step = 1 DlgCalModel.Step = 1
...@@ -124,32 +124,24 @@ Dim bDoEnable as Boolean ...@@ -124,32 +124,24 @@ Dim bDoEnable as Boolean
Dim sSelectedItem Dim sSelectedItem
Dim ListIndex as Integer Dim ListIndex as Integer
Dim MaxSelIndex as Integer Dim MaxSelIndex as Integer
Dim iMonth as Integer Dim CurEvMonth as Integer
Dim CurEvDay as Integer
Dim DateStr as String
bDoEnable = False bDoEnable = False
With DlgCalModel With DlgCalModel
MaxSelIndex = Ubound(DlgCalModel.lstOwnData.SelectedItems()) MaxSelIndex = Ubound(DlgCalModel.lstOwnData.SelectedItems())
If MaxSelIndex &gt; -1 Then If MaxSelIndex &gt; -1 Then
ListIndex = .lstOwnData.SelectedItems(MaxSelIndex) ListIndex = .lstOwnData.SelectedItems(MaxSelIndex)
.txtEvent.Text = CalGetNameofEvent(ListIndex) .txtEvent.Text = CalGetNameofEvent(ListIndex)
.txtOwnEventDay.Value = CalGetDayOfEvent(ListIndex) If GetSelectedDateUnits(CurEvDay, CurEvMonth, ListIndex) &lt;&gt; SBDATEUNDEFINED Then
iMonth = CalGetMonthOfEvent(ListIndex) .txtOwnEventDay.Value = CurEvDay
DlgCalendar.GetControl(&quot;lstOwnEventMonth&quot;).SelectItemPos(iMonth-1, True) DlgCalendar.GetControl(&quot;lstOwnEventMonth&quot;).SelectItemPos(CurEvMonth-1, True)
CurOwnMonth = DlgCalModel.lstOwnEventMonth.SelectedItems(0) + 1 .cmdDelete.Enabled = True
If CalGetYearofEvent(ListIndex) &lt;&gt; 0 Then .cmdInsert.Enabled = True
.txtOwnEventYear.Value = CalGetYearofEvent(ListIndex)
bDoEnable = True
Else Else
bDoEnable = False Call CalClearInputMask()
DlgCalModel.txtOwnEventYear.SetPropertyToDefault(&quot;Value&quot;) .cmdDelete.Enabled = True
End If End If
.chkEventOnce.State = Abs(bDoEnable)
.lblEventYear.Enabled = bDoEnable
.txtOwnEventYear.Enabled = bDoEnable
.cmdDelete.Enabled = True
.cmdInsert.Enabled = True
Else
Call CalClearInputMask()
.cmdDelete.Enabled = False
End If End If
End With End With
End Sub</script:module> End Sub</script:module>
\ No newline at end of file
...@@ -6,7 +6,6 @@ Sub Main() ...@@ -6,7 +6,6 @@ Sub Main()
Call CalAutopilotTable() Call CalAutopilotTable()
End Sub End Sub
Function CalGetGermanLandAtMousePos(byval X as single, byval Y as single) as Integer Function CalGetGermanLandAtMousePos(byval X as single, byval Y as single) as Integer
CalChoosenLand = 0 CalChoosenLand = 0
If (X&gt;73)And(X&lt;130)And(Y&gt;=117)And(Y&lt;181) Then If (X&gt;73)And(X&lt;130)And(Y&gt;=117)And(Y&lt;181) Then
...@@ -69,17 +68,6 @@ End Function ...@@ -69,17 +68,6 @@ End Function
Sub CalFindWholeYearHolidays_GERMANY(ByVal iSelYear as Integer, ByVal iCountry as Integer) Sub CalFindWholeYearHolidays_GERMANY(ByVal iSelYear as Integer, ByVal iCountry as Integer)
&apos; Ermittelt die Feiertage eines gesamten Jahres (Parameter iSelYear),
&apos; bezogen auf ein bestimmtes Bundesland (Parameter iCountry). Kein
&apos; bestimmtes Bundesland bedeutet, dass der Parameter gleich der
&apos; Konstante calBLHamburg ist, da Hamburg nur Standardfeiertage kennt.
&apos; Die Feiertage werden in das Array CalBankHolidayName$ geschrieben.
&apos; Der Index dieses Arrays geht bis vierhundert. Der 1. Januar hat den
&apos; Indexwert 1, der 2. Januar den Indexwert 2 usw. Das bedeutet, daß
&apos; wenn am 2. Januar kein Feiertag existiert, liefert
&apos; CalBankHolidayName$(DateSerial(0, 1, 2) eine leere Zeichenkette (&quot;&quot;).
Dim So as Integer Dim So as Integer
Dim OsternDate&amp;, VierterAdvent&amp; Dim OsternDate&amp;, VierterAdvent&amp;
...@@ -130,7 +118,7 @@ Sub CalFindWholeYearHolidays_GERMANY(ByVal iSelYear as Integer, ByVal iCountry a ...@@ -130,7 +118,7 @@ Sub CalFindWholeYearHolidays_GERMANY(ByVal iSelYear as Integer, ByVal iCountry a
CalInsertBankholiday(vierterAdvent-32, &quot;Buß- und Bettag&quot;, cHolidayType_Full) CalInsertBankholiday(vierterAdvent-32, &quot;Buß- und Bettag&quot;, cHolidayType_Full)
Else Else
CalInsertBankholiday(vierterAdvent-32, &quot;Buß- und Bettag&quot;, cHolidayType_Half) CalInsertBankholiday(vierterAdvent-32, &quot;Buß- und Bettag&quot;, cHolidayType_Half)
End If &apos; Dank an die EKD für die Berechnungsvorschrift des Buß- und Bettags! End If
CalInsertBankholiday(vierterAdvent-21, &quot;1. Advent&quot;, cHolidayType_Full) CalInsertBankholiday(vierterAdvent-21, &quot;1. Advent&quot;, cHolidayType_Full)
CalInsertBankholiday(vierterAdvent-14, &quot;2. Advent&quot;, cHolidayType_Full) CalInsertBankholiday(vierterAdvent-14, &quot;2. Advent&quot;, cHolidayType_Full)
CalInsertBankholiday(vierterAdvent-7, &quot;3. Advent&quot;, cHolidayType_Full) CalInsertBankholiday(vierterAdvent-7, &quot;3. Advent&quot;, cHolidayType_Full)
......
...@@ -12,6 +12,7 @@ Public Const cLANGUAGE_SPANISH = &quot;es&quot;, cLANGUAGE_SWEDISH = &quot;sv&qu ...@@ -12,6 +12,7 @@ Public Const cLANGUAGE_SPANISH = &quot;es&quot;, cLANGUAGE_SWEDISH = &quot;sv&qu
Public BLNameList(0 To 16) as String Public BLNameList(0 To 16) as String
&apos; R e s o u r c e s t r i n g c o n s t a n t s &apos; R e s o u r c e s t r i n g c o n s t a n t s
&apos; ------------------------------------------------- &apos; -------------------------------------------------
&apos; Dialog labels start at 1000 &apos; Dialog labels start at 1000
...@@ -71,8 +72,8 @@ Const dlgShortMonth = 1225 ...@@ -71,8 +72,8 @@ Const dlgShortMonth = 1225
.lblEvent.Label = GetResText(1019) .lblEvent.Label = GetResText(1019)
.lblEventDay.Label = GetResText(1021) .lblEventDay.Label = GetResText(1021)
.lblEventMonth.Label = GetResText(1022) .lblEventMonth.Label = GetResText(1022)
.lblEventYear.Label = GetResText(1023) &apos; .lblEventYear.Label = GetResText(1023)
.chkEventOnce.Label = GetResText(1020) &apos; .chkEventOnce.Label = GetResText(1020)
.cmdInsert.Label = GetResText(1016) .cmdInsert.Label = GetResText(1016)
.cmdDelete.Label = GetResText(1017) .cmdDelete.Label = GetResText(1017)
&apos; Load long month names &apos; Load long month names
......
...@@ -45,6 +45,7 @@ Dim lDate&amp; ...@@ -45,6 +45,7 @@ Dim lDate&amp;
End Sub End Sub
Sub FindWholeYearHolidays_FI(ByVal YearInt as Integer) Sub FindWholeYearHolidays_FI(ByVal YearInt as Integer)
Dim OsternDate&amp; Dim OsternDate&amp;
&apos; New Year &apos; New Year
...@@ -78,9 +79,9 @@ Dim lDate&amp;, VierterAdvent&amp; ...@@ -78,9 +79,9 @@ Dim lDate&amp;, VierterAdvent&amp;
&apos;New Year &apos;New Year
CalInsertBankholiday(DateSerial(YearInt, 1, 1), &quot;Nytårsdag&quot;, cHolidayType_Full) CalInsertBankholiday(DateSerial(YearInt, 1, 1), &quot;Nytårsdag&quot;, cHolidayType_Full)
lDate = CalEasterTable (YearInt) lDate = CalEasterTable (YearInt)
&apos;&quot;Fasching&quot; &apos; carnival
CalInsertBankholiday(lDate-49, &quot;Fastelavn&quot;, cHolidayType_Half) CalInsertBankholiday(lDate-49, &quot;Fastelavn&quot;, cHolidayType_Half)
&apos;&quot;Gründonnerstag&quot; &apos;&quot;Maundy Tuesday
CalInsertBankholiday(lDate-3, &quot;Skærtorsdag&quot;, cHolidayType_Full) CalInsertBankholiday(lDate-3, &quot;Skærtorsdag&quot;, cHolidayType_Full)
&apos;&quot;Good Friday &quot; &apos;&quot;Good Friday &quot;
CalInsertBankholiday(lDate-2, &quot;Langfredag&quot;, cHolidayType_Full) CalInsertBankholiday(lDate-2, &quot;Langfredag&quot;, cHolidayType_Full)
...@@ -148,6 +149,7 @@ Dim lDate&amp; ...@@ -148,6 +149,7 @@ Dim lDate&amp;
End Sub End Sub
Sub FindWholeYearHolidays_TRK(ByVal YearInt as Integer) Sub FindWholeYearHolidays_TRK(ByVal YearInt as Integer)
Dim lDate as Long Dim lDate as Long
&apos; New Years&apos; Day &apos; New Years&apos; Day
...@@ -206,6 +208,8 @@ Dim lRamazanBayRamStartDate as Long ...@@ -206,6 +208,8 @@ Dim lRamazanBayRamStartDate as Long
Case 2008 Case 2008
lKurbanBayRamStartDate = DateSerial(iSelYear, 12, 7) lKurbanBayRamStartDate = DateSerial(iSelYear, 12, 7)
lRamazanBayRamStartDate = DateSerial(iSelYear, 9, 29) lRamazanBayRamStartDate = DateSerial(iSelYear, 9, 29)
Case Else
Exit Sub
End Select End Select
&apos;Feast Of the Sacrifice Eve &apos;Feast Of the Sacrifice Eve
CalInsertBankholiday(lKurbanBayRamStartDate, &quot;Kurban Bayramı Arefesi&quot;, cHolidayType_Half) CalInsertBankholiday(lKurbanBayRamStartDate, &quot;Kurban Bayramı Arefesi&quot;, cHolidayType_Half)
...@@ -274,6 +278,7 @@ Dim lDate as Long ...@@ -274,6 +278,7 @@ Dim lDate as Long
End Sub End Sub
Sub FindWholeYearHolidays_SPAIN(ByVal YearInt as Integer) Sub FindWholeYearHolidays_SPAIN(ByVal YearInt as Integer)
Dim lDate&amp; Dim lDate&amp;
CalInsertBankholiday(DateSerial(YearInt, 1, 1), &quot;Año Nuevo&quot;, cHolidayType_Full) CalInsertBankholiday(DateSerial(YearInt, 1, 1), &quot;Año Nuevo&quot;, cHolidayType_Full)
...@@ -537,7 +542,7 @@ End Sub ...@@ -537,7 +542,7 @@ End Sub
Sub FindWholeYearHolidays_CN(YearInt as Integer) Sub FindWholeYearHolidays_CN(YearInt as Integer)
CalculateChineseNewYear(YearInt) CalculateChineseNewYear(YearInt)
CalInsertBankholiday(DateSerial(YearInt, 1, 1), &quot;元旦&quot;, cHolidayType_Full) &apos; New Year CalInsertBankholiday(DateSerial(YearInt, 1, 1), &quot;元旦&quot;, cHolidayType_Full) &apos; New Year
CalInsertBankholiday(DateSerial(YearInt, 3, 8), &quot;妇女节&quot;, cHolidayType_Half) &apos; Women&apos;s Day CalInsertBankholiday(DateSerial(YearInt, 3, 8), &quot;妇女节&quot;, cHolidayType_Half) &apos; Women&apos;s Day
CalInsertBankholiday(DateSerial(YearInt, 4, 5), &quot;清明节&quot;, cHolidayType_Half) &apos; Day of the deads CalInsertBankholiday(DateSerial(YearInt, 4, 5), &quot;清明节&quot;, cHolidayType_Half) &apos; Day of the deads
CalInsertBankholiday(DateSerial(YearInt, 5, 1), &quot;劳动节&quot;, cHolidayType_Full) &apos; International Labour Day CalInsertBankholiday(DateSerial(YearInt, 5, 1), &quot;劳动节&quot;, cHolidayType_Full) &apos; International Labour Day
CalInsertBankholiday(DateSerial(YearInt, 6, 1), &quot;儿童节&quot;, cHolidayType_Half) &apos; Children&apos;s Day CalInsertBankholiday(DateSerial(YearInt, 6, 1), &quot;儿童节&quot;, cHolidayType_Half) &apos; Children&apos;s Day
...@@ -628,7 +633,6 @@ Function CalculateJapaneseSpringDay(iSelYear as Integer) ...@@ -628,7 +633,6 @@ Function CalculateJapaneseSpringDay(iSelYear as Integer)
End Function End Function
Function CalculateJapaneseAutumnDay(iSelYear as Integer) Function CalculateJapaneseAutumnDay(iSelYear as Integer)
If (iSelYear &gt; 1979) And (iSelYear &lt; 2100) Then If (iSelYear &gt; 1979) And (iSelYear &lt; 2100) Then
CalculateJapaneseAutumnDay() = Int(23.8431 + 0.242194)* (iSelYear-1980) - (Int((iSelYear-1980)/4)) CalculateJapaneseAutumnDay() = Int(23.8431 + 0.242194)* (iSelYear-1980) - (Int((iSelYear-1980)/4))
......
...@@ -2,14 +2,13 @@ ...@@ -2,14 +2,13 @@
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd"> <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="OwnEvents" script:language="StarBasic">Option Explicit <script:module xmlns:script="http://openoffice.org/2000/script" script:name="OwnEvents" script:language="StarBasic">Option Explicit
Dim CurOwnMonth as Integer Public Const SBDATEUNDEFINED as Double = -98765432.1
Sub Main Sub Main
Call CalAutopilotTable() Call CalAutopilotTable()
End Sub End Sub
Sub CalSaveOwnData() Sub CalSaveOwnData()
Dim FileName as String Dim FileName as String
Dim FileChannel as Integer Dim FileChannel as Integer
...@@ -31,160 +30,141 @@ Dim LocList() as String ...@@ -31,160 +30,141 @@ Dim LocList() as String
End Sub End Sub
Function CalCreateDateFromInput() as Date
&apos; Generiert aus den Eingabedaten der Ereignisseite
&apos; ein Datum im Dateserial Format,
Dim newDate as Date
Dim EvDay as Integer
Dim EvYear as Integer
EvDay = DlgCalModel.txtOwnEventDay.Value
If DlgCalModel.chkEventOnce.State = 1 Then
EvYear = DlgCalModel.txtOwnEventYear.Value
newDate = DateSerial(EvYear, CurOwnMonth, EvDay)
Else
newDate = DateSerial(0, CurOwnMonth, EvDay)
End If
CalCreateDateFromInput = newDate
End Function
Function CalCreateDateStrOfInput() as String Function CalCreateDateStrOfInput() as String
Dim DateStr as String Dim DateStr as String
Dim EvMonth as Integer Dim CurOwnMonth as Integer
Dim EvDay as Integer Dim CurOwnDay as Integer
Dim CurMonthStr as String Dim FormatDateStr as String
EvDay = DlgCalModel.txtOwnEventDay.Value Dim dblDate as Double
If EvDay &lt; 10 Then Dim iLen as Integer
DateStr = &quot;0&quot; &amp; EvDay &amp; &quot;. &quot; Dim iDiff as Integer
Else Dim i as Integer
DateStr = Cstr(EvDay) &amp; &quot;. &quot; CurOwnDay = DlgCalModel.txtOwnEventDay.Value
End If CurOwnMonth = DlgCalendar.GetControl(&quot;lstOwnEventMonth&quot;).getselectedItemPos() + 1
CurMonthStr = DlgCalModel.lstOwnEventMonth.StringItemList(CurOwnMonth-1) DateStr = DateSerial(0, CurOwnMonth, CurOwnDay)
If Len(CurMonthStr) = 2 Then dblDate = CDbl(DateValue(DateStr))
CurMonthStr = CurMonthStr &amp; &quot; &quot; FormatDateStr = oNumberFormatter.convertNumberToString(lDateFormat, dblDate)
End If iLen = Len(FormatDateStr)
DateStr = DateStr &amp; CurMonthStr iDiff = 16 - iLen
If iDiff &gt; 0 Then
If DlgCalModel.chkEventOnce.State = 1 And DlgCalModel.txtOwnEventYear.Value &lt;&gt; 0 Then For i = 0 To iDiff
DateStr = DateStr &amp; &quot; &quot; + DlgCalModel.txtOwnEventYear.Value FormatDateStr = FormatDateStr + &quot; &quot;
Next i
Else Else
DateStr = DateStr + &quot; &quot; MsgBox(&quot;Invalid DateFormat: &apos;FormatDateStr&apos;&quot;, 16, sWizardTitle)
End If CalCreateDateStrOfInput = &quot;&quot;
DateStr = DateStr + &quot; &quot; + Trim(DlgCalModel.txtEvent.Text) Exit Function
End If
DateStr = FormatDateStr &amp; Trim(DlgCalModel.txtEvent.Text)
CalCreateDateStrOfInput = DateStr CalCreateDateStrOfInput = DateStr
End Function End Function
Function CalGetDateWithoutYear&amp;(ByVal i as Integer)
CalGetDateWithoutYear&amp; = DateSerial(0, CalGetMonthOfEvent(i), CalGetDayOfEvent(i))
End Function
Sub CalcmdInsertData() Sub CalcmdInsertData()
Dim MaxIndex as Integer
Dim UIDateStr as String
Dim DateStr as String Dim DateStr as String
Dim LastIndex as Integer Dim NewDate as Double
Dim bGetYear as Boolean
Dim NewDate as Date
Dim bInserted as Boolean Dim bInserted as Boolean
Dim bDateDoubled as Boolean
Dim EvYear as Integer
Dim i as Integer Dim i as Integer
Dim CurDate as Date Dim CurOwnDay as Integer
Dim CurEvYear as Integer Dim CurOwnMonth as Integer
Dim CurEvMonth as Integer Dim CurOwnYear as Integer
Dim CurEvDay as Integer CurOwnDay = DlgCalModel.txtOwnEventDay.Value
CurOwnMonth = DlgCalendar.GetControl(&quot;lstOwnEventMonth&quot;).getSelectedItemPos() + 1
bGetYear = DlgCalModel.chkEventOnce.State = 1 UIDateStr = CalCreateDateStrOfInput()
LastIndex = Ubound(DlgCalModel.lstOwnData.StringItemList()) NewDate = GetDateUnits(CurOwnDay, CurOwnMonth, UIDateStr)
If bGetYear Then If UIDateStr = &quot;&quot; Then Exit Sub
EvYear = DlgCalModel.txtOwnEventYear.Value MaxIndex = Ubound(DlgCalModel.lstOwnData.StringItemList())
End If If MaxIndex = -1 Then
DlgCalendar.GetControl(&quot;lstOwnData&quot;).AddItem(UIDateStr, 0 + 1)
newDate = CalCreateDateFromInput()
DateStr = CalCreateDateStrOfInput()
If DateStr = &quot;&quot; Then Exit Sub
&apos; Es ist noch garnichts vorhanden
If Ubound(DlgCalModel.lstOwnData.StringItemList()) = -1 Then
DlgCalendar.GetControl(&quot;lstOwnData&quot;).AddItem(DateStr, 0 + 1)
bInserted = True bInserted = True
Else Else
&apos; gleiche jahre(auch keine Jahre sind gleiche jahre)-&gt;alt löschen neu rein Dim CurEvMonth(MaxIndex) as Integer
Dim CurEvDay(MaxIndex) as Integer
Dim CurDate(MaxIndex) as Double
&apos; same Years(&quot;no years&quot; are treated like same years) -&gt; delete old entry and insert new one
i = 0 i = 0
Do Do
CurEvYear = CalGetYearOfEvent(i) CurDate(i) = GetSelectedDateUnits(CurEvDay(i), CurEvMonth(i), i)
CurEvMonth = CalGetMonthOfEvent(i) If CurDate(i) = NewDate Then
CurEvDay = CalGetDayOfEvent(i)
If DateSerial(CurEvYear, CurEvMonth, CurEvDay) = NewDate Then
&apos; Todo: Abchecken wie das ist mit &apos;Ereignis einmalig&apos; oder nicht
DlgCalendar.GetControl(&quot;lstOwnData&quot;).RemoveItems(i,1) DlgCalendar.GetControl(&quot;lstOwnData&quot;).RemoveItems(i,1)
DlgCalendar.GetControl(&quot;lstOwnData&quot;).AddItem(DateStr, i) DlgCalendar.GetControl(&quot;lstOwnData&quot;).AddItem(UIDateStr, i)
bInserted = True bInserted = True
End If End If
i = i + 1 i = i + 1
Loop Until bInserted Or i &gt; LastIndex Loop Until bInserted Or i &gt; MaxIndex
&apos; Es existiert ein Datum mit Jahreszahl. Es wird dasselbe Datum &apos; There exists already a date
&apos; ohne Angabe der Jahreszahl angegeben. If Not bInserted Then
If Not bInserted And Not bGetYear Then
i = 0
Do
bInserted = CalGetDateWithoutYear(i) = newDate
If bInserted Then
If CalGetYearOfEvent(i) &lt;&gt; 0 Then
DlgCalendar.GetControl(&quot;lstOwnData&quot;).AddItem(DateStr, i+1)
End If
End If
i = i + 1
Loop Until bInserted Or i &gt; LastIndex
End If
&apos; Das einzufügende Datum besitzt eine Jahreszahl, es gibt bereits
&apos; das Datum in der Liste, jedoch ohne Datum.
If Not bInserted And bGetYear Then
i = 0 i = 0
Do Do
bInserted = CalGetDateWithoutYear(i) = newDate If (CurEvMonth(i) = CurOwnMonth) And (CurEvDay(i) = CurOwnDay) Then
i = i + 1 bInserted = True
If bInserted Then DlgCalendar.GetControl(&quot;lstOwnData&quot;).RemoveItems(i,1)
DlgCalendar.GetControl(&quot;lstOwnData&quot;).AddItem(DateStr, i) DlgCalendar.GetControl(&quot;lstOwnData&quot;).AddItem(UIDateStr, i)
End If End If
Loop Until bInserted Or i &gt; LastIndex i = i + 1
Loop Until bInserted Or i &gt; MaxIndex
End If End If
&apos; Das Datum ist noch nicht vorhanden und wird richtig einsortiert &apos; The date is not yet existing and will will be sorted in accordingly
If Not bInserted And Not bDateDoubled Then If Not bInserted Then
i = 0 i = 0
Do Do
CurDate = CalGetDateWithoutYear(i) bInserted = NewDate &lt; CurDate(i)
bInserted = newDate &lt; CurDate
If bInserted Then If bInserted Then
Exit Do DlgCalendar.GetControl(&quot;lstOwnData&quot;).AddItem(UIDateStr, i)
End If End If
i = i + 1 i = i + 1
Loop Until bInserted Or i &gt; LastIndex Loop Until bInserted Or i &gt; MaxIndex
DlgCalendar.GetControl(&quot;lstOwnData&quot;).AddItem(DateStr, i) If Not bInserted Then
DlgCalendar.GetControl(&quot;lstOwnData&quot;).AddItem(UIDateStr, MaxIndex+1)
End If
End If End If
End If End If
bCalOwnDataChanged = True bCalOwnDataChanged = True
Call CalClearInputMask() Call CalClearInputMask()
End Sub End Sub
Function CalGetYearOfEvent(ByVal ListIndex as Integer) as Integer Function GetSelectedDateUnits(CurEvDay as Integer, CurEvMonth as Integer, i as Integer) as Double
Dim YearStr as String Dim dblDate as Double
YearStr = DlgCalModel.lstOwnData.StringItemList(ListIndex) Dim DateStr as String
CalGetYearOfEvent = Val(Mid(YearStr, 10, 4)) dblDate = SBDATEUNDEFINED
DateStr = DlgCalModel.lstOwnData.StringItemList(i)
If DateStr &lt;&gt; &quot;&quot; Then
dblDate = GetDateUnits(CurEvDay, CurEvMonth, DateStr)
End If
GetSelectedDateUnits() = dblDate
End Function End Function
Function CalGetDayOfEvent(ByVal ListIndex as Integer) as Integer Function GetDateUnits(CurEvDay as Integer, CurEvMonth as Integer, DateStr) as Double
Dim DayStr as String Dim bEventOnce as String
DayStr = DlgCalModel.lstOwnData.StringItemList(ListIndex) Dim LocDateStr as String
CalGetDayOfEvent = Val(Left(DayStr,2)) Dim dblDate as Double
Dim lDate as Long
LocDateStr = Mid(DateStr, 1, 15)
LocDateStr = Trim(LocDateStr)
bEventOnce = True
On Local Error Goto NODATEFORMAT
dblDate = oNumberFormatter.convertStringToNumber(lDateFormat, LocDateStr)
lDate = Clng(dblDate)
CurEvMonth = Month(lDate)
CurEvDay = Day(lDate)
GetDateUnits() = dblDate
Exit Function
GetDateUnits() =SBDATEUNDEFINED
NODATEFORMAT:
If Err &lt;&gt; 0 Then
MsgBox(&quot;Error: Date : &apos; &quot; &amp; LocDateStr &amp; &quot;&apos; is not a valid Format&quot;, 16, sWizardTitle)
Resume GETRETURNVALUE
GETRETURNVALUE:
GetDateUnits() = SBDATEUNDEFINED
End If
End Function End Function
...@@ -196,35 +176,25 @@ Dim NameStr as String ...@@ -196,35 +176,25 @@ Dim NameStr as String
End Function End Function
Function CalGetMonthOfEvent(ByVal ListIndex as Integer) as Integer
Dim MonthStr as String
MonthStr = DlgCalModel.lstOwnData.StringItemList(ListIndex)
MonthStr = Mid(MonthStr, 5, 3)
&apos; In chinese Short Monthnames may be only 2 characters long.
&apos; In this case the third character is filled up with an empty space
MonthStr = RTrim(MonthStr)
CalGetMonthOfEvent = CalGetIntOfShortMonthName(MonthStr)
End Function
Function GetOwnYear()
If DlgCalModel.chkEventOnce.State = 1 Then
GetOwnYear() = DlgCalModel.txtOwnEventYear.Value
Else
GetOwnYear() = Year(Now())
End If
End Function
Sub CheckInsertedDates() Sub CheckInsertedDates(Optional ControlEnvironment, Optional CurOwnMonth as Integer)
Dim EvYear as Long Dim EvYear as Long
Dim EvDay as Long Dim EvDay as Long
Dim sEvMonth as String Dim sEvMonth as String
Dim bDoEnable as Boolean Dim bDoEnable as Boolean
EvYear = GetOwnYear() Dim ListboxName as String
bDoEnable = (EvYear &lt;&gt; 0) And (CurOwnMonth &gt; 0) Dim MaxValue as Integer
If Not IsMissing(ControlEnvironment) Then
CurOwnMonth = DlgCalendar.GetControl(&quot;lstOwnEventMonth&quot;).getSelectedItemPos()+1
End If
EvYear = Year(Now())
bDoEnable = CurOwnMonth &lt;&gt; 0
If bDoEnable Then If bDoEnable Then
DlgCalModel.txtOwnEventDay.ValueMax = CalMaxDayInMonth(EvYear, CurOwnMonth) MaxValue = CalMaxDayInMonth(EvYear, CurOwnMonth)
DlgCalModel.txtOwnEventDay.ValueMax = MaxValue
If DlgCalModel.txtOwnEventDay.Value &gt; MaxValue Then
DlgCalModel.txtOwnEventDay.Value = MaxValue
End If
bDoEnable = DlgCalModel.txtOwnEventDay.Value &lt;&gt; 0 bDoEnable = DlgCalModel.txtOwnEventDay.Value &lt;&gt; 0
If bDoEnable Then If bDoEnable Then
bDoEnable = Ubound(DlgCalModel.lstOwnEventMonth.SelectedItems()) &gt; -1 bDoEnable = Ubound(DlgCalModel.lstOwnEventMonth.SelectedItems()) &gt; -1
...@@ -239,8 +209,9 @@ End Sub ...@@ -239,8 +209,9 @@ End Sub
Sub GetOwnMonth() Sub GetOwnMonth()
Dim EvYear as Integer Dim EvYear as Integer
EvYear = GetOwnYear() Dim CurOwnMonth as Integer
EvYear = year(now())
CurOwnMonth = DlgCalModel.lstOwnEventMonth.SelectedItems(0) + 1 CurOwnMonth = DlgCalModel.lstOwnEventMonth.SelectedItems(0) + 1
DlgCalModel.txtOwnEventDay.ValueMax = CalMaxDayInMonth(EvYear, CurOwnMonth) DlgCalModel.txtOwnEventDay.ValueMax = CalMaxDayInMonth(EvYear, CurOwnMonth)
CheckInsertedDates() CheckInsertedDates(,CurOwnMonth)
End Sub</script:module> End Sub</script:module>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment