Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to loop through date range in javascript

var now = new Date();
var daysOfYear = [];
for (var d = new Date(2012, 0, 1); d <= now; d.setDate(d.getDate() + 1)) {
    daysOfYear.push(new Date(d));
}
Source by newbedev.com #
 
PREVIOUS NEXT
Tagged: #loop #date #range #javascript
ADD COMMENT
Topic
Name
4+3 =