
Fehler in "date.au3" - v3.3.8.1
-
x0r -
16. Dezember 2015 um 09:23 -
Erledigt
-
-
- Offizieller Beitrag
In der aktuellen Version von AutoIt (v3.3.14.2) funktioniert es.
Hier die entsprechende Funktion:AutoIt
Alles anzeigen; #FUNCTION# ==================================================================================================================== ; Author ........: Tuape ; Modified.......: JdeB: modified to UDF standards & Doc., Change calculation logic. ; =============================================================================================================================== Func _WeekNumberISO($iYear = @YEAR, $iMonth = @MON, $iDay = @MDAY) ; Check for erroneous input in $Day, $Month & $Year If $iDay > 31 Or $iDay < 1 Then Return SetError(1, 0, -1) ElseIf Not __DateIsMonth($iMonth) Then Return SetError(2, 0, -1) ElseIf $iYear < 1 Or $iYear > 2999 Then Return SetError(3, 0, -1) EndIf Local $iDow = _DateToDayOfWeekISO($iYear, $iMonth, $iDay) - 1; Local $iDow0101 = _DateToDayOfWeekISO($iYear, 1, 1) - 1; If ($iMonth = 1 And 3 < $iDow0101 And $iDow0101 < 7 - ($iDay - 1)) Then ;days before week 1 of the current year have the same week number as ;the last day of the last week of the previous year $iDow = $iDow0101 - 1; $iDow0101 = _DateToDayOfWeekISO($iYear - 1, 1, 1) - 1; $iMonth = 12 $iDay = 31 $iYear = $iYear - 1 ElseIf ($iMonth = 12 And 30 - ($iDay - 1) < _DateToDayOfWeekISO($iYear + 1, 1, 1) - 1 And _DateToDayOfWeekISO($iYear + 1, 1, 1) - 1 < 4) Then ; days after the last week of the current year have the same week number as ; the first day of the next year, (i.e. 1) Return 1; EndIf Return Int((_DateToDayOfWeekISO($iYear, 1, 1) - 1 < 4) + 4 * ($iMonth - 1) + (2 * ($iMonth - 1) + ($iDay - 1) + $iDow0101 - $iDow + 6) * 36 / 256) EndFunc ;==>_WeekNumberISO
-
- Offizieller Beitrag
hier erhalte ich "50", wobei die aktuelle Kalenderwoche "51" ist.
v3.3.8.1.... und deshalb sollte man zumindest gelegentlich seine Software aktualisieren. Der Fehler ist schon recht lange gefixed, war in deiner Version aber noch vorhanden.
-