javascript - How to check 2 date fields and compare to see which date is ahead, behind or the same -


i'm working 2 dates posted me in textbox strings in format 03/02/2010. 1 current completion date , second final completion date. need compare these 2 dates check if final completion date ends being ahead, behind or same current completion date.

is there way can using javascript or jquery?

thanks help.

var passeddate1 = new date('03/02/2010'); var passeddate2 = new date('03/01/2010');  if (passeddate1 > passeddate2) {    alert ('date1 greated date 2'); } else if (passeddate1 < passeddate2) {    alert ('date1 less date 2'); } else {    alert ('they equal'); } 

Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -