La mia personale soluzione al problema:
ciaocodice:<% Function isFest(giorno) ' festivita' infrasettimanali (MMGG) BF_F = " 0101 0106 0425 0501 0815 1101 1208 1225 1226 " '&& FISSI BF_F = BF_F & " 1030 " '&& PATRONO (Cagliari) isFest = False ' eliminare le linee seguenti se il sabato e' lavorativo if Weekday(giorno)=7 then ' sabato isFest = True end if ' pasquetta o festivita' in giorno feriale if IsPasqua(DateAdd("D",-1,giorno)) _ or InStr(bf_f,mmdd)>0 then isFest = True end if if Weekday(giorno)=1 then ' domenica ff = isFest = True end if End Function '* * * * * ------------- ** ------------------------------------------------- * FUNCTION Pasqua(wA) '&& RITORNA DATA DELLA PASQUA fra il 1753 e il 2500 '* * * * * ------------- ** ------------------------------------------------- * w1 = wA mod 19 w2 = wA mod 4 w3 = wA mod 7 w4 = (19 * w1 + 24) mod 30 w5 = 0 '&& correzione per secoli if wA < 2500 then w5 = 3 if wA < 2300 then w5 = 2 if wA < 2200 then w5 = 1 if wA < 2100 then w5 = 0 if wA < 1900 then w5 = 6 if wA < 1800 then w5 = 5 if wA < 1700 then w5 = 4 wG = (2 * w2 + 4 * w3 + 6 * w4 + 5 + w5) mod 7 wG = 22 + w4 + wG wM = 3 if wG > 31 then wM = 4 wG = wG - 31 end if Pasqua = DateSerial(wA,wM,wG) end function '* * * * * ------------- ** ------------------------------------------------- * FUNCTION IsPasqua(wDG) ' RITORNA True SE E' PASQUA '* * * * * ------------- ** ------------------------------------------------- * ' esempio d'uso: ' Pasquetta = IsPasqua(DateAdd("D",-1,giorno)) IsPasqua = false IF Weekday(wDG) <> 1 then exit function END IF wMG = right("0"&Month(wDG),2)&right("0"&Day(wDG),2) IF wMG < "0322" or wMG > "0425" then exit function END IF IsPasqua = (wDG = Pasqua(Year(wDG))) end function %>

Rispondi quotando