Tuesday, March 24, 2009

Getting Start week date for the given date

function commonformat(objDate)
{
var strdate=objDate.split("/");
var yer=strdate[2];
var da=strdate[0];
var mon=strdate[1];
var cdat=new Date(yer,mon,da);
var countDay=cdat.getDay();
if(countDay!="0")
{
cdat.setDate(cdat.getDate()-countDay);
}
return cdat;
}