import { formatDate } from './format' ; export function getIntervalOfDates ( startDate , endDate ) { const dates = [ ] ; let currentDate = startDate ; const addDays = function ( this , days ) { const dt = new Date ( this . valueOf ( ) ) ; dt . setDate ( dt . getDate ( ) + days ) ; return dt . getTime ( ) ; } ; while ( currentDate <= endDate ) { dates . push ( formatDate ( currentDate ) ) ; currentDate = addDays . call ( currentDate , 1 ) ; } return dates ; }