Compare dates with javascript

date, javascript

Solution

if( (new Date(first).getTime() > new Date(second).getTime()))
{
    ----------------------------------
}

Problem

I have two dates in javascript: ``` var first = '2012-11-21'; var second = '2012-11-03'; ``` i would like make: ``` if(first > second){ //... } ``` how is the best way for this, without external library?

Original source

Related problems