Date object Comparison in Javascript

Document created by Rabia_Sozkesen Employee on Nov 6, 2015Last modified by luis_nevarez on Mar 1, 2016
Version 2Show Document
  • View in full screen mode
The below script compares the ImportDate value to CurrentDate and returns ImportDate value if they are equal:

 

function CompareDates(imp,curr)
{
   if((imp.getYear() == curr.getYear()) &&
      (imp.getMonth() == curr.getMonth()) &&
      (imp.getDate() == curr.getDate()) )
     {return imp;}
   else
     {return "";}
}

 

Output = CompareDates(ImportDate, CurrentDate);

0EM40000000N3gL
1 person found this helpful

Attachments

    Outcomes