Avatar

Level 10

Seems like it is a little more complicated just to create a new Date() object in livecycle...

the way I found to create a new Date() object is using the dateTimeEdit pattern to be 'date{EEEE, MMMM D, YYYY}'

then u can create a new Date

var date1 = new Date(DateTimeField1.editValue);

date1.getTime();

or

you can also click the following link and download the pdf from the blog...

Adobe LiveCycle Designer Cookbooks by BR001: Date handling in Livecycle Designer ES forms

using XFADate object make it easy to manipulate dates with javascript

The XFADate object created by BR001 is very good but to be able to see if a date is prior to another date you can just add this function in the object script..

you can add that function at line 200...

To use that function above you can just use this code:

if (XFADate.newDate(dateFrom).isPriorTo(DateTo)){

     //dateFrom is prior to dateTo

}

hope this help