Check out example codes for "ts loop through days in dates". It will help you in understanding the concepts better.

Code Example 1

public IEnumerable<DateTime> EachDay(DateTime from, DateTime thru)
{
    for(var day = from.Date; day.Date <= thru.Date; day = day.AddDays(1))
        yield return day;
}

Learn ReactJs, React Native from akashmittal.com