Created
September 28, 2016 07:35
-
-
Save sendtomitesh/99d64cc16aeaa9598f51f4a9f595d235 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (startDate, endDate, addFn, interval) { | |
addFn = addFn || Date.prototype.addDays; | |
interval = interval || 1; | |
var retVal = []; | |
var current = new Date(startDate); | |
while (current <= endDate) { | |
retVal.push(new Date(current)); | |
current = addFn.call(current, interval); | |
} | |
return retVal; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment