Date comparison in javascript

Hello everyone.
i have doubt regarding the date comparison. my problem is...

In my php form, i have text fields where i am entering the from date, to date in a format specified by the MyClient Base(it uses CI). When i click the submit button, i need to check the date values. So, i am passing the from date, to date, current date and the date format( eg. "dd/mm/yyyy") to the javascript function. in this function i need to check these values.
But i dont know, how to check these values...may be i have to use "convert to time unit" etc....

Plz give me advice.

Thanks in advance.

Well as far as i know,if you pass variables containing dates in any format, javascript Lng is smart enough to see which one of the two is greater .
But you can send all the data to be processed on server side , and use php's strtotime function to convert the date in unix time , so a comparision between two timestamps will be more obvious .
$dateA = '11/11/2011';
$dateB = '12/10/2008';
$dateA = strtotime($dateA);
$dateB = strtotime($dateB);
if( $dateA > $dateB )

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.