// (C) 2007-2019 GoodData Corporation import { clone } from "lodash"; const addOneDay = (date: Date) => date.setDate(date.getDate() + 1); export function* datesBetween(startDate: Date, finalDate: Date): IterableIterator { const currentDate = clone(startDate); while (currentDate <= finalDate) { yield clone(currentDate); addOneDay(currentDate); } }