var parse = require('./parse')

/**
 * Returns array of dates withtin specified range.
 * @param {date|string} dirtyStart
 * @param {date|string} dirtyEnd
 * @returns {date[]}
 */
var eachDay = function(dirtyStart, dirtyEnd) {
  var endTime = parse(dirtyEnd).getTime()
  var dates = []
  var tmpDate

  var curDate = parse(dirtyStart)
  curDate.setHours(0, 0, 0, 0)

  while (curDate.getTime() <= endTime) {
    dates.push(new Date(curDate))

    curDate.setDate(curDate.getDate() + 1)

    /**
     * add additional 5 hours to get next day,
     * because of possible troubles with daylight savings dates
     */
    tmpDate = new Date(curDate.setTime(curDate.getTime() + 5 * 60 * 60 * 1000))
    tmpDate = new Date(tmpDate.setHours(0, 0, 0, 0))
    curDate = tmpDate
  }

  return dates
}

module.exports = eachDay


var parse = require('./parse')

/**
 * Returns array of dates withtin specified range.
 * @param {date|string} dirtyStart
 * @param {date|string} dirtyEnd
 * @returns {date[]}
 */
var eachDay = function(dirtyStart, dirtyEnd) {
  var endTime = parse(dirtyEnd).getTime()
  var dates = []

  var currentDate = parse(dirtyStart)
  currentDate.setHours(0, 0, 0, 0)

  while (currentDate.getTime() <= endTime) {
    dates.push(new Date(currentDate))
    currentDate.setDate(currentDate.getDate() + 1)
  }

  return dates
}

module.exports = eachDay


Remove DST fix in `eachDay` function
Remove DST fix in `eachDay` function
