Calculate Date difference in days in lscript

Hello Frends,I have two fields naming date1 and date2 of type Text. Both taking date from date picker accessed using java script. Now I want to calculate the difference between two dates. So Please Help!!!

Subject: Use timeDifferenceDouble

Look for timeDifferenceDouble in designer help.

Renaud