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

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

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -