// This function calculates the difference between the Date field of SharePoint and the current Date.
function calculateDays()
{
var myDate = $('input[title="Date"]').val();
var chunks = myDate.split('/');
var formattedDate = new Date([chunks[1],chunks[0],chunks[2]].join("/"));
var currDate = new Date(new Date().getTime());
console.log( Math.floor((currDate-formattedDate)/(1000*60*60*24)));
return Math.floor((currDate-formattedDate)/(1000*60*60*24));
}
function calculateDays()
{
var myDate = $('input[title="Date"]').val();
var chunks = myDate.split('/');
var formattedDate = new Date([chunks[1],chunks[0],chunks[2]].join("/"));
var currDate = new Date(new Date().getTime());
console.log( Math.floor((currDate-formattedDate)/(1000*60*60*24)));
return Math.floor((currDate-formattedDate)/(1000*60*60*24));
}
No comments:
Post a Comment