Get dates in future for only certain days of the week. DateInterval?

My Idea

Private Function CreateDateSeries(fromDate As DateTime, toDate As DateTime, DayOfWeekAllowed() As Boolean) As DateTime()
  
  Var dates() As DateTime
  
  Var currentDate As DateTime = fromDate
  
  Do
    
    If DayOfWeekAllowed(currentDate.DayOfWeek) = True Then '1=Sunday, 7=Saturday
      dates.AddRow(currentDate)
    End If
    
    currentDate = currentDate + New DateInterval(0,0,1) '+1 Day
    
  Loop Until currentDate > toDate
  
  Return dates
End Function

Test

Var fromDate As DateTime = DateTime.Now
Var toDate As DateTime = DateTime.Now + New DateInterval(0,3,0)

Var dates() As DateTime = CreateDateSeries(fromDate,toDate ,Array(False,False,True,False,True,False,True,False))

System.DebugLog fromDate.ToString(DateTime.FormatStyles.Full) + " - " + toDate.ToString(DateTime.FormatStyles.Full)

For Each d As DateTime In dates
  System.DebugLog d.ToString(DateTime.FormatStyles.Full)
Next