Hi everyone, based on @Erel example HERE i edit the code for get what title says.
ElapsedDaysInMonth:
Public Sub ElapsedDaysInMonth (FirstDay As Long, LastDay As Long, RelevantDays As B4XSet) As Int
Dim Day As Long = DateUtils.SetDate(DateTime.GetYear(FirstDay), DateTime.GetMonth(FirstDay), DateTime.GetDayOfMonth(FirstDay))
Dim p As Period : p.Days = 1
Dim total As Int
Do While DateTime.GetMonth(Day) = DateTime.GetMonth(LastDay)
If RelevantDays.Contains(DateTime.GetDayOfWeek(Day)) Then total = total + 1
Day = DateUtils.AddPeriod(Day, p)
Loop
Return total
End Sub
Example::
Dim ID As B4XSet = B4XCollections.CreateSet2(Array(1, 2, 3, 4, 5)) 'number of days excluding Friday and Saturday
Dim elapDays As Int = ElapsedDaysInMonth(Date1,Date2,ID)