' Passare la data in formato gg-MM-aaaa.
Public Sub isFestivo(Data As String, Roma As Boolean) As Boolean
Dim Festivo As Boolean
Dim PrevDateFormat As String = DateTime.DateFormat
DateTime.DateFormat = "dd-MM-yyyy"
Dim GiornoData, MeseData, AnnoData As Int
Dim DataTicks As Long
DataTicks = DateTime.DateParse(Data)
AnnoData = DateTime.GetYear(DataTicks)
GiornoData = DateTime.GetDayOfMonth(DataTicks)
MeseData = DateTime.GetMonth(DataTicks)
Dim Domenica As Boolean
Domenica = (DateTime.GetDayOfWeek(DataTicks) = 1)
Dim DataPasqua As String
Dim GiornoPasqua, MesePasqua As Int
Dim PasquaTicks As Long
DateTime.DateFormat = "MM-dd-yyyy"
DataPasqua = GetEasterSunday(AnnoData, "")
PasquaTicks = DateTime.DateParse(DataPasqua)
GiornoPasqua = DateTime.GetDayOfMonth(PasquaTicks)
MesePasqua = DateTime.GetMonth(PasquaTicks)
Dim lstFestivi As List
lstFestivi.Initialize
Dim GiornoMesePasqua As String
GiornoMesePasqua = GiornoPasqua & "-" & MesePasqua
GiornoMeseFestaRoma As String = ""
If Roma then
GiornoMeseFestaRoma = "29-6"
End If
lstFestivi.AddAll(Array As String("1-1", "6-1", "25-04", "1-5", "2-6", "15-8", "1-11", "8-12", "25-12", "26-12", GiornoMesePasqua, GiornoMeseFestaRoma))
Dim GiornoMeseData As String
GiornoMeseData = GiornoData & "-" & MeseData
Festivo = (lstFestivi.IndexOf(GiornoMeseData) > - 1) Or Domenica
DateTime.DateFormat = PrevDateFormat
Return Festivo
End Sub