I use this function to get the current week
Date.prototype.getWeek = function(start)
{
start = start || 1;
today = new Date(this.setHours(0, 0, 0, 0));
var day = today.getDay() - start;
date = today.getDate() - day;
var giorni = [];
var currdate;
for(var i = 0;i<7;i++){
if(getNumberOfDays(today.getFullYear(),today.getMonth()) == currdate){
var changed=1;
var newdate=new Date(today.getFullYear(),today.getMonth()+1,1);
giorni.push(newdate);
}else{
if(changed==1){
var dt = newdate.getDate();
giorni.push(new Date(today.getFullYear(),today.getMonth()+1,dt+1));
newdate = new Date(today.getFullYear(),today.getMonth(),dt+1);
}else{
giorni.push(new Date(today.setDate(date+i)));
}
}
currdate = date+i;
}
}
var Dates = new Date().getWeek();
But in this week it displays wrong dates..(From 30 November to 6 November)
Any suggestion? ( this is the plunker -> plnkr.co/edit/48NyxngWNGIlOps1Arew?p=preview)