I am working in an application where i am comparing selected date from fullcalendar with current date where i need to check the selected date is less than the current date or advance the current date. What i have done i am posting here 

```
var selectedDate = $('#selectedDate').val();
var today = new Date();
var str_date = selectedDate.split(',');

for(var i =0 ;i<str_date.length;i++){

    str_date[i] = str_date[i].replace(/^\s*/, "").replace(/\s*$/, "");

    if(str_date[i] <=today){
        alert('before date')
    }
} 

```

This code is not working it is not able to check the date which is a back date or the date which is an advance date from the calendar.Please someone help .