Top_bottom banner
// How to Compare Dates using JavaScript?
    function ValidateDates()
    {
    var Date1 = Xrm.Page.getAttribute(‘<Date Attribute Name1>’).getValue();
    var Date2 = Xrm.Page.getAttribute(‘<Date Attribute Name2>’).getValue();
     if(Date1 != null && Date2 != null)
     {
     if(Date1.setHours(0,0,0,0) < Date2.setHours(0,0,0,0))
     {
     alert(‘Date2 is greater than or equal to Date1’);
     }
     }
    }

Please share |Like in Facebook if you feel like this page is useful.

Top_bottom banner

Advertisements