Compare dates with different formats

Compare two dates with different formats. This can help confirm or resolve date inconsistencies.

Note:

There are also several helper functions available for date comparisons. These functions may reduce your coding effort. For details, see Date and time functions.

For example, the Date Performed (Date format) on the Physical exam form should be the same as the Check In date (date and time format) on the Housing form but they are different. You can create a rule to confirm that the Physical Exam was not done at the same time as the Check In or resolve the inconsistent dates.

var ci_dt = ci_datetime.getDate() + "-" + (ci_datetime.getMonth() + 1) + "-" + ci_datetime.getFullYear();
var pe_dt = pe_date.getDate() + "-" + (pe_date.getMonth() + 1) + "-" + pe_date.getFullYear();
 if (ci_dt !== pe_dt){
  return false;
}