Quantcast
Channel: Adobe Community : All Content - LiveCycle Designer
Viewing all articles
Browse latest Browse all 5571

Determine if end date is after start date

$
0
0

I have 2 date fields on a form.  When I click the submit button I am trying to make sure the end date is after the start date.

 

Here is the code I am using:

     var sDate = Date.parse(BackgroundInformation.Background.CheckingDateStart.rawValue);

      var eDate = Date.parse(BackgroundInformation.Background.CheckingDateEnd.rawValue);

      xfa.host.messageBox("Start Date:" + BackgroundInformation.Background.CheckingDateStart.rawValue);

      xfa.host.messageBox("eDate:"+eDate+" sDate:"+sDate);

      if(sDate > eDate)

{
   valid = false;
   fieldName +="Start Date is greater than End Date";
}

 

The message box shows the start date as 2014-10-30 but sDate is Nan.

 

I have tried:

     var eDate = new Date(BackgroundInformation.Background.CheckingDateEnd.rawValue);

      var sDate = new Date(BackgroundInformation.Background.CheckingDateStart.rawValue);

 

and when I display sDate is says "Invalid Date"

 

Any ideas?


Viewing all articles
Browse latest Browse all 5571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>