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?