Bundesländer

  • hi, Guten Morgen ...

    öhmm, heute sind mal unsere 16 Bundesländer drann, es werden so einige Feiertag angezeigt in abhänigkeit des ausgewählem Bundeslandes, darf man dann arbeiten oder hat frei ...

    Viel Spaß damit - wer es gebrauchen kann ...

    Einmal editiert, zuletzt von trallala (26. Juli 2006 um 04:06)

  • Hallo Gemeinde,

    Ich bastel wieder mal an die "Bundesländer" herrum und würde gern noch ein paar "Labels" mit Daten füllen (Feiertagsdaten), nur habe ich noch keinen Plan wie ich sie berechne. :( :hammer:

    Für Tipp's und Anregungen schon einmal vielen Dank!

    MfG
    trallala

    Spoiler anzeigen
    [autoit]


    #NoTrayIcon
    #include <Date.au3>
    Global Const $ES_AUTOVSCROLL = 64
    Global Const $ES_AUTOHSCROLL = 128
    Global Const $ES_WANTRETURN = 4096
    Global Const $WS_BORDER = 0x00800000
    Global Const $WS_POPUPWINDOW = 0x80880000
    Global Const $WS_EX_CLIENTEDGE = 0x00000200
    Global Const $WS_EX_TOOLWINDOW = 0x00000080
    Global Const $ES_READONLY = 0x0800
    Global Const $WS_DLGFRAME = 0x00400000
    Global Const $GUI_CHECKED = 1
    Global Const $GUI_EVENT_CLOSE = -3
    Global Const $GUI_SHOW = 16
    Global Const $GUI_HIDE = 32
    Global Const $GUI_DISABLE = 128
    Global Const $BS_FLAT = 0x8000
    Global Const $BS_CENTER = 0x0300
    Global Const $SS_CENTER = 0x01
    ;
    ; --- 16 Bundesländer mit 17 Feiertagen (status 0 oder 1)
    Dim $Bundesland[16][18] = _
    [["Baden-Württemberg",0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0], _
    ["Bayern",0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0], _
    ["Berlin",0,1,0,0,0,0,0,0,0,1,1,0,1,1,1,0,0], _
    ["Brandenburg",0,1,0,0,0,0,0,0,0,1,1,0,0,1,1,0,0], _
    ["Bremen",0,1,0,0,0,0,0,0,0,1,1,0,1,1,1,0,0], _
    ["Hamburg",0,1,0,0,0,0,0,0,0,1,1,0,1,1,1,0,0], _
    ["Hessen",0,1,0,0,0,0,0,0,0,0,1,0,1,1,1,0,0], _
    ["Mecklenburg-Vorpommern",0,1,0,0,0,0,0,0,0,1,1,0,0,1,1,0,0], _
    ["Niedersachsen",0,1,0,0,0,0,0,0,0,1,1,0,1,1,1,0,0], _
    ["Nordrhein-Westfalen",0,1,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0], _
    ["Rheinland-Pfalz",0,1,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0], _
    ["Saarland",0,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0], _
    ["Sachsen",0,1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0], _
    ["Sachsen-Anhalt",0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,0,0], _
    ["Schleswig-Holstein",0,1,0,0,0,0,0,0,0,1,1,0,1,1,1,0,0], _
    ["Thüringen",0,1,0,0,0,0,0,0,0,1,1,0,0,1,1,0,0]]
    ; --- status 0/1 = arbeitsfrei/normal
    Dim $Freizeit[2] = ["Arbeitsfrei","Normal"]
    ; --- Namen der 17 Feiertage
    Dim $Feiertage[17] = _
    ["Neujahr","Hl. 3 Könige","Karfreitag","Ostersonntag", _
    "Ostermontag","Tag der Arbeit","Christi Himmelfahrt","Pfingstsonntag", _
    "Pfingstmontag","Fronleichnam","Maria Himmelfahrt","T. d. Deutschen Einheit", _
    "Reformationstag","Allerheiligen","Buß- und Bettag","1 Weinachtstag","2 Weinachtstag"]
    ;--- Haupt-Formular
    ;
    $Form1 = GUICreate("Test", 796, 467, 171, 114, $WS_DLGFRAME)
    GUISetFont(10, 400, 0, "MS Sans Serif")
    GUISetBkColor(0xA6CAF0)
    ;
    ;--- Radio-Buttons für die Bundesland-Auswahl ---
    ;
    Dim $Land[16]
    $Group2 = GUICtrlCreateGroup("Bundesland", 400, 8, 208, 321, $BS_CENTER)
    $Land[0] = GUICtrlCreateRadio($Bundesland[0][0], 408, 32, 190, 18)
    $Land[1] = GUICtrlCreateRadio($Bundesland[1][0], 408, 48, 190, 18)
    $Land[2] = GUICtrlCreateRadio($Bundesland[2][0], 408, 64, 190, 18)
    $Land[3] = GUICtrlCreateRadio($Bundesland[3][0], 408, 80, 190, 18)
    $Land[4] = GUICtrlCreateRadio($Bundesland[4][0], 408, 96, 190, 18)
    $Land[5] = GUICtrlCreateRadio($Bundesland[5][0], 408, 112, 190, 18)
    $Land[6] = GUICtrlCreateRadio($Bundesland[6][0], 408, 128, 190, 18)
    $Land[7] = GUICtrlCreateRadio($Bundesland[7][0], 408, 144, 190, 18)
    $Land[8] = GUICtrlCreateRadio($Bundesland[8][0], 408, 160, 190, 18)
    $Land[9] = GUICtrlCreateRadio($Bundesland[9][0], 408, 176, 190, 18)
    $Land[10] = GUICtrlCreateRadio($Bundesland[10][0], 408, 192, 190, 18)
    $Land[11] = GUICtrlCreateRadio($Bundesland[11][0], 408, 208, 190, 18)
    $Land[12] = GUICtrlCreateRadio($Bundesland[12][0], 408, 224, 190, 18)
    $Land[13] = GUICtrlCreateRadio($Bundesland[13][0], 408, 240, 190, 18)
    $Land[14] = GUICtrlCreateRadio($Bundesland[14][0], 408, 256, 190, 18)
    $Land[15] = GUICtrlCreateRadio($Bundesland[15][0],408, 272, 190, 18)
    GUICtrlSetState($Land[0], $GUI_CHECKED)
    ;
    ;--- Spalten der Feiertage ---
    ;
    $Group1 = GUICtrlCreateGroup("Feiertage", 16, 8, 369, 321, $BS_CENTER)
    GUISetFont(10, 400, 0, "MS Sans Serif")
    GUISetBkColor(0xA6CAF0)
    GUICtrlCreateLabel($Feiertage[0], 24, 32, 160, 18)
    GUICtrlCreateLabel($Feiertage[1], 24, 48, 160, 18)
    GUICtrlCreateLabel($Feiertage[2], 24, 64, 160, 18)
    GUICtrlCreateLabel($Feiertage[3], 24, 80, 160, 18)
    GUICtrlCreateLabel($Feiertage[4], 24, 96, 160, 18)
    GUICtrlCreateLabel($Feiertage[5], 24, 112, 160, 18)
    GUICtrlCreateLabel($Feiertage[6], 24, 128, 160, 18)
    GUICtrlCreateLabel($Feiertage[7], 24, 144, 160, 18)
    GUICtrlCreateLabel($Feiertage[8], 24, 160, 160, 18)
    GUICtrlCreateLabel($Feiertage[9], 24, 176, 160, 18)
    GUICtrlCreateLabel($Feiertage[10], 24, 192, 160, 18)
    GUICtrlCreateLabel($Feiertage[11], 24, 208, 160, 18)
    GUICtrlCreateLabel($Feiertage[12], 24, 224, 160, 18)
    GUICtrlCreateLabel($Feiertage[13], 24, 240, 160, 18)
    GUICtrlCreateLabel($Feiertage[14], 24, 256, 160, 18)
    GUICtrlCreateLabel($Feiertage[15], 24, 272, 160, 18)
    GUICtrlCreateLabel($Feiertage[16], 24, 288, 160, 18)
    ;GUICtrlCreateLabel("Silvester", 24, 304, 160, 18)
    ;
    ;--- arbeitsfrei --- oder auch nicht :)
    ;
    ;--- 01 - Neujahr
    GUICtrlCreateLabel("", 296, 32, 70, 18)
    ;--- 02 - Erscheinungsfest
    GUICtrlCreateLabel("", 296, 48, 70, 18)
    ;--- 03 - Karfreitag
    GUICtrlCreateLabel("", 296, 64, 70, 18)
    ;--- 04 - Ostersonntag
    GUICtrlCreateLabel("", 296, 80, 70, 18)
    ;--- 05 - Ostermontag
    GUICtrlCreateLabel("", 296, 96, 70, 18)
    ;--- 06 - Maifeiertag
    GUICtrlCreateLabel("", 296, 112, 70, 18)
    ;--- 07 - Christi Himmelfahrt
    GUICtrlCreateLabel("", 296, 128, 70, 18)
    ;--- 08 - Pfingstsonntag
    GUICtrlCreateLabel("", 296, 144, 70, 18)
    ;--- 09 - Pfingstmontag
    GUICtrlCreateLabel("", 296, 160, 70, 18)
    ;--- 10 - Fronleichnam
    GUICtrlCreateLabel("", 296, 176, 70, 18)
    ;--- 11 - Mariä Himmelfahrt
    GUICtrlCreateLabel("", 296, 192, 70, 18)
    ;--- 12 - Tag der deutschen Einheit
    GUICtrlCreateLabel("", 296, 208, 70, 18)
    ;--- 13 - Reformationstag
    GUICtrlCreateLabel("", 296, 224, 70, 18)
    ;--- 14 - Allerheiligen
    GUICtrlCreateLabel("", 296, 240, 70, 18)
    ;--- 15 - Buß - und Bettag
    GUICtrlCreateLabel("", 296, 256, 70, 18)
    ;--- 16 - 1. Weihnachten
    GUICtrlCreateLabel("", 296, 272, 70, 18)
    ;--- 17 - 2. Weihnachten
    GUICtrlCreateLabel("", 296, 288, 70, 18)
    ;--- 18 - Silvester
    GUICtrlCreateLabel("", 296, 304, 70, 18)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    ;
    ;--- Felder für Feiertagsdaten (Platzhalter)// Daten müßten noch berechnet weden ....---
    ;
    ;--- 01 - Neujahr
    $Feier01 = GUICtrlCreateLabel("", 208, 32, 70, 18)
    ;--- 02 - Hl. 3 Könige
    $Feier02 = GUICtrlCreateLabel("", 208, 48, 70, 18)
    ;--- 03 - Karfreitag
    $Feier03 = GUICtrlCreateLabel("", 208, 64, 70, 18)
    ;--- 04 - Ostersonntag
    $Feier04 = GUICtrlCreateLabel("", 208, 80, 70, 18)
    ;--- 05 - Ostermontag
    $Feier05 = GUICtrlCreateLabel("", 208, 96, 70, 18)
    ;--- 06 - Tag der Arbeit
    $Feier06 = GUICtrlCreateLabel("", 208, 112, 70, 18)
    ;--- 07 - Christi Himmelfahrt
    $Feier07 = GUICtrlCreateLabel("", 208, 128, 70, 18)
    ;--- 08 - Pfingstsonntag
    $Feier08 = GUICtrlCreateLabel("", 208, 144, 70, 18)
    ;--- 09 - Pfingstmontag
    $Feier09 = GUICtrlCreateLabel("", 208, 160, 70, 18)
    ;--- 10 - Fronleichnam
    $Feier10 = GUICtrlCreateLabel("", 208, 176, 70, 18)
    ;--- 11 - Maria Himmelfahrt
    $Feier11 = GUICtrlCreateLabel("", 208, 192, 70, 18)
    ;--- 12 - T. d. Deutschen Einheit
    $Feier12 = GUICtrlCreateLabel("", 208, 208, 70, 18)
    ;--- 13 - Reformationstag
    $Feier13 = GUICtrlCreateLabel("", 208, 224, 70, 18)
    ;--- 14 - Allerheiligen
    $Feier14 = GUICtrlCreateLabel("", 208, 240, 70, 18)
    ;--- 15 - Buß- und Bettag
    $Feier15 = GUICtrlCreateLabel("", 208, 256, 70, 18)
    ;--- 16 - 1 Weinachtstag
    $Feier16 = GUICtrlCreateLabel("", 208, 272, 70, 18)
    ;--- 17 - 2 Weinachtstag
    $Feier17 = GUICtrlCreateLabel("", 208, 288, 70, 18)
    ;--- 18 - Silvester
    ;GUICtrlCreateLabel("", 208, 304, 70, 18)
    ;
    ;--- Ausgabefeld für Freitag den 13.
    ;
    $Group3 = GUICtrlCreateGroup("Freitag der 13.", 624, 8, 160, 185, $BS_CENTER)
    GUISetFont(10, 400, 0, "MS Sans Serif")
    GUISetBkColor(0xA6CAF0)
    $Fr13 = GUICtrlCreateLabel("", 664, 32, 108, 18)
    GUICtrlCreateLabel("", 664, 64, 108, 18)
    GUICtrlCreateLabel("", 664, 96, 108, 18)
    GUICtrlCreateLabel("", 664, 128, 108, 18)
    GUICtrlCreateLabel("", 664, 160, 108, 18)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    ;
    ;--- Ausgabefeld für die Sommer-/Winterzeit
    ;
    $Group4 = GUICtrlCreateGroup("Zeitumstellung", 624, 200, 160, 129, $BS_CENTER)
    GUISetFont(10, 400, 0, "MS Sans Serif")
    GUISetBkColor(0xA6CAF0)
    GUICtrlCreateLabel("Sommerzeit", 656, 224, 90, 18, $SS_CENTER)
    $Som = GUICtrlCreateLabel("-", 656, 248, 90, 18, $SS_CENTER)
    GUICtrlCreateLabel("Winterzeit", 656, 272, 90, 18, $SS_CENTER)
    $Win = GUICtrlCreateLabel("-", 656, 296, 90, 18, $SS_CENTER)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    ;
    ;--- Bedienelemente --- Auswahl des Kalender-Jahres, Anzeigen und Beenden
    ;
    $Group6 = GUICtrlCreateGroup("Bedienung", 16, 344, 768, 89, $BS_CENTER)
    GUISetFont(10, 400, 0, "MS Sans Serif")
    GUISetBkColor(0xA6CAF0)
    ;
    ;--- Jahr (vorgabe ist das aktuelle Jahr - Direkteingabe möglich oder per +/- ändern)
    ;
    $wert1 = GUICtrlCreateInput(StringMid(_NowCalcDate(), 1, 4), 72, 392, 40, 18)
    ;
    ;--- minus ein Jahr
    ;
    $runter = GUICtrlCreateButton("-", 40, 392, 25, 18, $BS_FLAT)
    ;
    ;--- plus ein Jahr
    ;
    $hoch = GUICtrlCreateButton("+", 120, 392, 25, 18, $BS_FLAT)
    ;
    ;--- Anzeigen-Button
    ;
    $ok = GUICtrlCreateButton("Anzeigen", 344, 392, 105, 18, $BS_FLAT)
    ;
    ;--- Beenden-Button
    ;
    $Beenden = GUICtrlCreateButton("Beenden", 648, 392, 105, 18, $BS_FLAT)
    GUICtrlCreateLabel("Jahr", 40, 368, 105, 18, $SS_CENTER)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUISetState(@SW_SHOW)
    ;
    ;--- Aktionen ---
    ;
    While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    ExitLoop
    Case $msg = $Beenden
    ExitLoop
    Case $msg = $runter
    GUICtrlSetData($wert1, GUICtrlRead($wert1) - 1)
    ; _Fr13Leer($trallala)
    Case $msg = $hoch
    GUICtrlSetData($wert1, GUICtrlRead($wert1) + 1)
    ; _Fr13Leer($trallala)
    Case $msg = $ok
    $Jahr = GUICtrlRead($wert1)
    For $i =0 to 15
    $Auswahl = GUICtrlRead($Land[$i])
    Select
    Case $Auswahl = 1
    GUICtrlSetData($Feier01, $Freizeit[$Bundesland[$i][1]])
    GUICtrlSetData($Feier02, $Freizeit[$Bundesland[$i][2]])
    GUICtrlSetData($Feier03, $Freizeit[$Bundesland[$i][3]])
    GUICtrlSetData($Feier04, $Freizeit[$Bundesland[$i][4]])
    GUICtrlSetData($Feier05, $Freizeit[$Bundesland[$i][5]])
    GUICtrlSetData($Feier06, $Freizeit[$Bundesland[$i][6]])
    GUICtrlSetData($Feier07, $Freizeit[$Bundesland[$i][7]])
    GUICtrlSetData($Feier08, $Freizeit[$Bundesland[$i][8]])
    GUICtrlSetData($Feier09, $Freizeit[$Bundesland[$i][9]])
    GUICtrlSetData($Feier10, $Freizeit[$Bundesland[$i][10]])
    GUICtrlSetData($Feier11, $Freizeit[$Bundesland[$i][11]])
    GUICtrlSetData($Feier12, $Freizeit[$Bundesland[$i][12]])
    GUICtrlSetData($Feier13, $Freizeit[$Bundesland[$i][13]])
    GUICtrlSetData($Feier14, $Freizeit[$Bundesland[$i][14]])
    GUICtrlSetData($Feier15, $Freizeit[$Bundesland[$i][15]])
    GUICtrlSetData($Feier16, $Freizeit[$Bundesland[$i][16]])
    GUICtrlSetData($Feier17, $Freizeit[$Bundesland[$i][17]])
    EndSelect
    Next
    _Freitag13te($Jahr)
    _Sommerzeit($Jahr)
    EndSelect
    WEnd
    ;
    ;--- Funktionen ---
    Func _Freitag13te($Jahr)
    ;- felder leeren
    GUICtrlCreateLabel("", 664, 32, 108, 18)
    GUICtrlCreateLabel("", 664, 64, 108, 18)
    GUICtrlCreateLabel("", 664, 96, 108, 18)
    GUICtrlCreateLabel("", 664, 128, 108, 18)
    GUICtrlCreateLabel("", 664, 160, 108, 18)
    ;- Start
    $x=1
    For $i = 1 to 12
    $Fr13te = _DateToDayOfWeek ( $Jahr, $i, 13)
    $wert2 = _DateMonthOfYear($i,0)
    If $Fr13te = 6 Then
    $x=$x+1
    $Fr13 = GUICtrlCreateLabel("", 664, 1+($x*32), 108, 18)
    GUICtrlSetData($Fr13, $wert2)
    EndIf
    Next
    ;- Ende
    EndFunc
    ;
    Func _Sommerzeit($Jahr)
    $Somz = _DateToDayOfWeek ( $Jahr, 3,31) - 1
    $Winz = _DateToDayOfWeek ( $Jahr,10,31) - 1
    GUICtrlSetData($Som, 31-$Somz & ".03." & $Jahr)
    GUICtrlSetData($Win, 31-$Winz & ".10." & $Jahr)
    EndFunc

    [/autoit]
    • Offizieller Beitrag

    Hi,
    Feiertagsberechnung hatte ich schon mal gemacht. Findest du auch bei den Skripten. Hier nochmal die Funktion:

    Spoiler anzeigen
    [autoit]

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ; Funktion _Feiertage($Jahr)
    ;
    ; gibt die Feiertage des übergebenen Jahres
    ; als sortiertes Array[TT.MM.JJJJ \ Feiertag] zurück
    ; (Trennzeichen veränderbar über Variable: $Delimiter)
    ;
    ; Autor BugFix ([email='bugfix@autoit.de'][/email])
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    [/autoit] [autoit][/autoit] [autoit]

    #include <math.au3>
    #include <Date.au3>
    #include <Array.au3>

    [/autoit] [autoit][/autoit] [autoit]

    Func _Feiertage($year)
    Dim $4AdvDat, $3AdvDat, $2AdvDat, $1AdvDat, $TotSoDat, $BuBDat, $MutterDat, $ErnteDat, $tmp, $Delimiter = "\"
    Dim $HDays[32]

    ;fixe Feiertage
    $HDays[0] = $year & "/01/01" & $Delimiter & "Neujahr"
    $HDays[1] = $year & "/01/06" & $Delimiter & "Heilige Drei Könige"
    $HDays[2] = $year & "/02/14" & $Delimiter & "Valentinstag"
    $HDays[3] = $year & "/05/01" & $Delimiter & "Maifeiertag"
    $HDays[4] = $year & "/10/03" & $Delimiter & "Tag der Deutschen Einheit"
    $HDays[5] = $year & "/10/31" & $Delimiter & "Reformationstag"
    $HDays[6] = $year & "/11/01" & $Delimiter & "Allerheiligen"
    $HDays[7] = $year & "/12/24" & $Delimiter & "Heiligabend"
    $HDays[8] = $year & "/12/25" & $Delimiter & "1. Weihnachtsfeiertag"
    $HDays[9] = $year & "/12/26" & $Delimiter & "2. Weihnachtsfeiertag"
    $HDays[10] = $year & "/12/31" & $Delimiter & "Silvester"

    [/autoit] [autoit][/autoit] [autoit]

    ;variable Feiertage
    $aa = Mod($year, 19)
    $bb = Mod($year, 4)
    $cc = Mod($year, 7)
    $H1 = Int($year / 100)
    $H2 = Int($year / 400)
    $N = 4 + $H1 - $H2
    $MM = 15 + $H1 - $H2 - _Floor (Int((8 * $H1 + 13) / 25))
    $dd = Mod((19 * $aa + $MM), 30)
    $ee = Mod((2 * $bb + 4 * $cc + 6 * $dd + $N), 7)
    If $dd + $ee = 35 Then
    $Easter = 50
    Else
    If $dd = 28 And $ee = 6 And $aa > 10 Then
    $Easter = 49
    Else
    $Easter = 22 + $dd + $ee
    EndIf
    EndIf
    If $Easter < 32 Then
    $EasterDay = $Easter
    $EasterMonth = "03"
    Else
    $EasterDay = $Easter - 31
    $EasterMonth = "04"
    EndIf
    If $EasterDay < 10 Then
    $EasterDay = "0" & $EasterDay
    EndIf

    If $year < 1900 Then ;Datumsoperationen nur mgl. wenn > 1900 , Jahr wird konvertiert
    $RestJahr = Mod($year, 100)
    If _DateIsLeapYear($year) Then
    If $RestJahr < 10 Then
    $RestJahr = "0" & $RestJahr
    EndIf
    $Tempyear = 20 & $RestJahr
    Else
    If $RestJahr < 10 Then
    $RestJahr = "0" & $RestJahr
    EndIf
    $Tempyear = 19 & $RestJahr
    EndIf
    $EasterDate = $Tempyear & "/" & $EasterMonth & "/" & $EasterDay
    Else
    $EasterDate = $year & "/" & $EasterMonth & "/" & $EasterDay
    EndIf
    $WFastDate = _DateAdd( 'd', -52, $EasterDate)
    $RosDat = _DateAdd( 'd', -48, $EasterDate)
    $FastDat = _DateAdd( 'd', -47, $EasterDate)
    $AschDat = _DateAdd( 'd', -46, $EasterDate)
    $GrDoDat = _DateAdd( 'd', -3, $EasterDate)
    $KarDat = _DateAdd( 'd', -2, $EasterDate)
    $OSaDat = _DateAdd( 'd', -1, $EasterDate)
    $OSoDat = $EasterDate
    $OMoDat = _DateAdd( 'd', 1, $EasterDate)
    $HiFaDat = _DateAdd( 'd', 39, $EasterDate)
    $PfSoDat = _DateAdd( 'd', 49, $EasterDate)
    $PfMoDat = _DateAdd( 'd', 50, $EasterDate)
    $FroDat = _DateAdd( 'd', 60, $EasterDate)

    ;Ermitteln nicht von Ostern abhängiger, veränderlicher Feiertage
    ;Muttertag = 2. Sonntag im Mai ABER wenn Pfingsten = 2.Sonntag im Mai dann ist Muttertag am 1. Sonntag
    ;Der 2. Sonntag kann nur zw. dem 8. u. 14.5. liegen
    For $maitag = 8 To 14
    If _DateToDayOfWeek($year, 5, $maitag) = 1 Then
    If $maitag < 10 Then
    $maitag = "0" & $maitag
    EndIf
    $MutterDat = $year & "/05/" & $maitag
    If $MutterDat = $PfSoDat Then
    $MutterDat = _DateAdd( 'd', -7, $year & "/05/" & $maitag)
    EndIf
    ExitLoop
    EndIf
    Next

    ;Erntedankfest 1. Sonntag im Oktober (zw. 1. u. 7.10.)
    For $oktobertag = 1 To 7
    If _DateToDayOfWeek($year, 10, $oktobertag) = 1 Then
    $oktobertag = "0" & $oktobertag
    $ErnteDat = $year & "/10/" & $oktobertag
    ExitLoop
    EndIf
    Next

    ;4.Advent = Sonntag vor 25.12. (zw. 18. u. 24.12.)
    For $deztag = 18 To 24
    If _DateToDayOfWeek($year, 12, $deztag) = 1 Then
    $4AdvDat = $year & "/12/" & $deztag
    $3AdvDat = _DateAdd( 'd', -7, $4AdvDat)
    $2AdvDat = _DateAdd( 'd', -14, $4AdvDat)
    $1AdvDat = _DateAdd( 'd', -21, $4AdvDat)
    $TotSoDat = _DateAdd( 'd', -28, $4AdvDat)
    $BuBDat = _DateAdd( 'd', -32, $4AdvDat)
    ExitLoop
    EndIf
    Next

    $HDays[11] = $WFastDate & $Delimiter & "Weiberfastnacht"
    $HDays[12] = $RosDat & $Delimiter & "Rosenmontag"
    $HDays[13] = $FastDat & $Delimiter & "Fastnacht"
    $HDays[14] = $AschDat & $Delimiter & "Aschermittwoch"
    $HDays[15] = $GrDoDat & $Delimiter & "Gründonnerstag"
    $HDays[16] = $KarDat & $Delimiter & "Karfreitag"
    $HDays[17] = $OSaDat & $Delimiter & "Ostersamstag"
    $HDays[18] = $OSoDat & $Delimiter & "Ostersonntag"
    $HDays[19] = $OMoDat & $Delimiter & "Ostermontag"
    $HDays[20] = $HiFaDat & $Delimiter & "Christi Himmelfahrt"
    $HDays[21] = $PfSoDat & $Delimiter & "Pfingstsonntag"
    $HDays[22] = $PfMoDat & $Delimiter & "Pfingstmontag"
    $HDays[23] = $MutterDat & $Delimiter & "Muttertag"
    $HDays[24] = $FroDat & $Delimiter & "Fronleichnam"
    $HDays[25] = $ErnteDat & $Delimiter & "Erntedankfest"
    $HDays[26] = $BuBDat & $Delimiter & "Buß- und Bettag"
    $HDays[27] = $TotSoDat & $Delimiter & "Totensonntag"
    $HDays[28] = $1AdvDat & $Delimiter & "1. Advent"
    $HDays[29] = $2AdvDat & $Delimiter & "2. Advent"
    $HDays[30] = $3AdvDat & $Delimiter & "3. Advent"
    $HDays[31] = $4AdvDat & $Delimiter & "4. Advent"
    _ArraySort($HDays)
    ;Datum konvertieren zu TT.MM.JJJJ
    For $i = 0 To 31
    $tmp = StringSplit($HDays[$i], $Delimiter)
    $HDays[$i] = StringMid($tmp[1], 9) & "." & StringMid($tmp[1], 6, 2) & "." & StringMid($tmp[1], 1, 4) & $Delimiter & $tmp[2]
    Next
    Return $HDays
    EndFunc ;==>_Feiertage

    [/autoit]
  • Hi,

    Danke für die schnelle Hilfe :klatschen:

    P.S: wenn man beruflich so sehr eingespannt wird, wie es bei mir im Moment ist, dann ist die einfachste Lösung einfach nicht in Sicht.

    MfG
    trallala

  • Hi,

    Hab da eine Modifizierte Variante für Österreich :)

    Spoiler anzeigen
    [autoit]

    Opt("WinWaitDelay",100)
    Opt("WinTitleMatchMode",4)
    Opt("WinDetectHiddenText",1)
    Opt("MouseCoordMode",0)
    #include <file.au3>
    #include <math.au3>
    #include <Date.au3>
    #include <Array.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $jahr = IniRead(@ScriptDir & "\Export.ini", "FEIERTAGS_JAHR", "FETA", @YEAR)
    ;~ $jahr =2006
    $txtFile = "Feiertage.txt"
    $Pfad = @ScriptDir & "\" & $txtFile
    $arFeiertage = _Feiertage($jahr)
    $file = FileOpen($Pfad, 2)
    For $i = 0 To UBound($arFeiertage)-1
    FileWriteLine($file, $arFeiertage[$i])
    Next
    FileClose($file)
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ; Funktion _Feiertage($Jahr)
    ;
    ; gibt die Feiertage des übergebenen Jahres
    ; als sortiertes Array[TT.MM.JJJJ \ Feiertag] zurück
    ; (Trennzeichen veränderbar über Variable: $Delimiter)
    ;
    ; Autor BugFix ([email='bugfix@autoit.de'][/email])
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    Func _Feiertage($year)
    Dim $4AdvDat, $3AdvDat, $2AdvDat, $1AdvDat, $TotSoDat, $BuBDat, $MutterDat, $ErnteDat, $tmp, $Delimiter = "."
    Dim $HDays[200]

    ;fixe Feiertage
    $HDays[0] = $year & "/01/01" ;& $Delimiter & "Neujahr"
    $HDays[1] = $year & "/01/06" ;& $Delimiter & "Heilige Drei Könige"
    $HDays[2] = $year & "/05/01" ;& $Delimiter & "Maifeiertag"
    $HDays[3] = $year & "/08/15" ;& $Delimiter & "Mariä Himmelfahrt"
    $HDays[4] = $year & "/10/26" ;& $Delimiter & "Nationalfeiertag"
    $HDays[5] = $year & "/11/01" ;& $Delimiter & "Allerheiligen"
    $HDays[6] = $year & "/12/08" ;& $Delimiter & "Mariä Empfängnis"
    $HDays[7] = $year & "/12/25" ;& $Delimiter & "1. Weihnachtsfeiertag"
    $HDays[8] = $year & "/12/26" ;& $Delimiter & "2. Weihnachtsfeiertag"

    [/autoit] [autoit][/autoit] [autoit]

    ;variable Feiertage
    $aa = Mod($year, 19)
    $bb = Mod($year, 4)
    $cc = Mod($year, 7)
    $H1 = Int($year / 100)
    $H2 = Int($year / 400)
    $N = 4 + $H1 - $H2
    $MM = 15 + $H1 - $H2 - _Floor (Int((8 * $H1 + 13) / 25))
    $dd = Mod((19 * $aa + $MM), 30)
    $ee = Mod((2 * $bb + 4 * $cc + 6 * $dd + $N), 7)
    If $dd + $ee = 35 Then
    $Easter = 50
    Else
    If $dd = 28 And $ee = 6 And $aa > 10 Then
    $Easter = 49
    Else
    $Easter = 22 + $dd + $ee
    EndIf
    EndIf
    If $Easter < 32 Then
    $EasterDay = $Easter
    $EasterMonth = "03"
    Else
    $EasterDay = $Easter - 31
    $EasterMonth = "04"
    EndIf
    If $EasterDay < 10 Then
    $EasterDay = "0" & $EasterDay
    EndIf

    If $year < 1900 Then ;Datumsoperationen nur mgl. wenn > 1900 , Jahr wird konvertiert
    $RestJahr = Mod($year, 100)
    If _DateIsLeapYear($year) Then
    If $RestJahr < 10 Then
    $RestJahr = "0" & $RestJahr
    EndIf
    $Tempyear = 20 & $RestJahr
    Else
    If $RestJahr < 10 Then
    $RestJahr = "0" & $RestJahr
    EndIf
    $Tempyear = 19 & $RestJahr
    EndIf
    $EasterDate = $Tempyear & "/" & $EasterMonth & "/" & $EasterDay
    Else
    $EasterDate = $year & "/" & $EasterMonth & "/" & $EasterDay
    EndIf
    $WFastDate = _DateAdd( 'd', -52, $EasterDate)
    $RosDat = _DateAdd( 'd', -48, $EasterDate)
    $FastDat = _DateAdd( 'd', -47, $EasterDate)
    $AschDat = _DateAdd( 'd', -46, $EasterDate)
    $GrDoDat = _DateAdd( 'd', -3, $EasterDate)
    $KarDat = _DateAdd( 'd', -2, $EasterDate)
    $OSaDat = _DateAdd( 'd', -1, $EasterDate)
    $OSoDat = $EasterDate
    $OMoDat = _DateAdd( 'd', 1, $EasterDate)
    $HiFaDat = _DateAdd( 'd', 39, $EasterDate)
    $PfSoDat = _DateAdd( 'd', 49, $EasterDate)
    $PfMoDat = _DateAdd( 'd', 50, $EasterDate)
    $FroDat = _DateAdd( 'd', 60, $EasterDate)

    ;Ermitteln nicht von Ostern abhängiger, veränderlicher Feiertage
    ;Muttertag = 2. Sonntag im Mai ABER wenn Pfingsten = 2.Sonntag im Mai dann ist Muttertag am 1. Sonntag
    ;Der 2. Sonntag kann nur zw. dem 8. u. 14.5. liegen
    For $maitag = 8 To 14
    If _DateToDayOfWeek($year, 5, $maitag) = 1 Then
    If $maitag < 10 Then
    $maitag = "0" & $maitag
    EndIf
    $MutterDat = $year & "/05/" & $maitag
    If $MutterDat = $PfSoDat Then
    $MutterDat = _DateAdd( 'd', -7, $year & "/05/" & $maitag)
    EndIf
    ExitLoop
    EndIf
    Next

    ;Erntedankfest 1. Sonntag im Oktober (zw. 1. u. 7.10.)
    For $oktobertag = 1 To 7
    If _DateToDayOfWeek($year, 10, $oktobertag) = 1 Then
    $oktobertag = "0" & $oktobertag
    $ErnteDat = $year & "/10/" & $oktobertag
    ExitLoop
    EndIf
    Next

    ;4.Advent = Sonntag vor 25.12. (zw. 18. u. 24.12.)
    For $deztag = 18 To 24
    If _DateToDayOfWeek($year, 12, $deztag) = 1 Then
    $4AdvDat = $year & "/12/" & $deztag
    $3AdvDat = _DateAdd( 'd', -7, $4AdvDat)
    $2AdvDat = _DateAdd( 'd', -14, $4AdvDat)
    $1AdvDat = _DateAdd( 'd', -21, $4AdvDat)
    $TotSoDat = _DateAdd( 'd', -28, $4AdvDat)
    $BuBDat = _DateAdd( 'd', -32, $4AdvDat)
    ExitLoop
    EndIf
    Next

    [/autoit] [autoit][/autoit] [autoit]

    $HDays[09] = $OSaDat ;& $Delimiter & "Ostersamstag"
    $HDays[10] = $OSoDat ;& $Delimiter & "Ostersonntag"
    $HDays[11] = $OMoDat ;& $Delimiter & "Ostermontag"
    $HDays[12] = $HiFaDat ;& $Delimiter & "Christi Himmelfahrt"
    $HDays[13] = $PfSoDat ;& $Delimiter & "Pfingstsonntag"
    $HDays[14] = $PfMoDat ;& $Delimiter & "Pfingstmontag"
    $HDays[15] = $FroDat ;& $Delimiter & "Fronleichnam"
    $HDays[16] = $TotSoDat ;& $Delimiter & "Totensonntag"
    $HDays[17] = $1AdvDat ;& $Delimiter & "1. Advent"
    $HDays[18] = $2AdvDat ;& $Delimiter & "2. Advent"
    $HDays[19] = $3AdvDat ;& $Delimiter & "3. Advent"
    $HDays[20] = $4AdvDat ;& $Delimiter & "4. Advent"
    $counter = 21

    ; Wochenenden einschließen (von peethebee)
    For $i = 0 to 365
    ;~ MsgBox(0, "", _DateAdd("d", $i, $year & "/01/01"))
    $wedate = _DateAdd("d", $i, $year & "/01/01")
    $parts = StringSplit($wedate, "/")
    $dow = _DateToDayOfWeek($parts[1], $parts[2], $parts[3])
    If $dow = 1 or $dow = 7 Then
    $HDays[$counter] = $wedate
    $counter += 1
    EndIf
    Next
    ReDim $HDays[$counter]

    _ArraySort($HDays)

    [/autoit] [autoit][/autoit] [autoit]

    Return $HDays
    EndFunc ;==>_Feiertage

    [/autoit]


    (PS: Danke BugFix)