Check out example codes for "lubridate sequence of dates". It will help you in understanding the concepts better.

Code Example 1

seq(ymd('2012-04-07'),ymd('2013-03-22'), by = 'weeks')

# you can replace weeks by days too

Learn ReactJs, React Native from akashmittal.com