Here simple working code, worked for me
var from = new Date(2012,0,1);_x000D_
var to = new Date(2012,1,20);_x000D_
_x000D_
// loop for every day_x000D_
for (var day = from; day <= to; day.setDate(day.getDate() + 1)) {_x000D_
_x000D_
// your day is here_x000D_
_x000D_
}
_x000D_