i have startdate and enddate string and i m converting string to date object
var startdate = start_date[3]+'-'+month_value_start+'-'+start_date[2]+' '+start_time[0]+':'+start_time[1]+':00';
var enddate = end_date[3]+'-'+month_value_end+'-'+end_date[2]+' '+end_time[0]+':'+end_time[1]+':00';
var s_date = new Date(startdate);
var e_date = new Date(enddate);
startdate and enddate format is like 2014-02-20 00:00:00
i want to compare this date object if s_date is greater than e_date popup will be shown to user
if(s_date > e_date)
{
alert('Start Date Cannot Be Greater Than End Date');
}
but some how if condition is not executing even if startdatetime is greater than enddatetime.
how to solve this issue any suggestions ?
Solved
program which i m using, automatically changes enddate in runtime if startdate is greater than end date. but no update on frontend ie datetimepicker textbox so on frontend enddate remains less than startdate but in background code has modified the enddate variable and that variable i was using to compare dates....sorry for troubling u guys....and thanks for helping me.