javascript in mscrm Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/javascript-in-mscrm/ Microsoft Dynamics CRM . Microsoft Power Platform Thu, 12 Mar 2015 08:01:00 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/cropped-Microsoftdynamics365-blogs.png?fit=32%2C32 javascript in mscrm Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/category/javascript-in-mscrm/ 32 32 176351444 Get Difference in days between two date fields using javascript ( differences between dates ) http://microsoftdynamics.in/2015/03/12/get-difference-in-days-between-two-date-fields-using-javascript-differences-between-dates/ http://microsoftdynamics.in/2015/03/12/get-difference-in-days-between-two-date-fields-using-javascript-differences-between-dates/#comments Thu, 12 Mar 2015 08:01:00 +0000 http://microsoftdynamics.in/2015/03/12/get-difference-in-days-between-two-date-fields-using-javascript-differences-between-dates/ Hello , below you will find function calculating difference in days between two field using java script . function diffrenceindays() { var startdate = GetDateValue(startfield); var Enddate = GetDateValue(endfield); var oneday = 1000 * 60 * 60 * 24; var differenceInDays = ((Enddate - startdate) / oneday); if (differenceInDays < 0) { alert(" date cannot...

The post Get Difference in days between two date fields using javascript ( differences between dates ) appeared first on Microsoft Dynamics 365 Blog.

]]>
Hello , below you will find function calculating difference in days between two field using java script .
function diffrenceindays() {
var startdate = GetDateValue(startfield);
var Enddate = GetDateValue(endfield);

var oneday = 1000 * 60 * 60 * 24;
var differenceInDays = ((Enddate - startdate) / oneday);
if (differenceInDays < 0) {
alert(" date cannot be less then start date");

}
alert(" diffrence in days " + differenceInDays);

}

function GetDateValue(field) {


var year = field.getFullYear();
var month = field.getMonth();
var day = field.getDate();
dateOnly = new Date(year, month, day);
return dateOnly;


}

SOURCE : JUST2CODE.IN Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

The post Get Difference in days between two date fields using javascript ( differences between dates ) appeared first on Microsoft Dynamics 365 Blog.

]]>
http://microsoftdynamics.in/2015/03/12/get-difference-in-days-between-two-date-fields-using-javascript-differences-between-dates/feed/ 2 2798