Saturday 18 April 2015



var spDate = $(input["DatetimeControlName"]).val(); // date value of the datetime control
var curDate = new Date(); // current date
var first = spDate.split("/"); split the date
var todayDate = (curDate.getDate()+"/"+ (curDate.getMonth()+1) + "/" + curDate.getFullYear()); // format the current date into dd/mm/yyyy format
var second = todayDate.split("/"); split the current date
var DTCdate = new Date(first[2],first[1]-1,first[0]); format the Sharepointdate into (yy,mm,dd)
var curDate = new Date(second[2],second[1]-1,second[0]); format the current date into (yy,mm,dd)
if(DTCdate > curDate){alert("Yes");}
else{alert("No");}

0 comments:

Post a Comment