//
function change(obj){
var timeOne = $("#choose_one").val();
var timeTwo = $("#choose_two").val();
//
var newdate= CurentTime();
if(CompareDate(timeOne,timeTwo)){
layer.alert(" ");
$(obj).val("");
return false;
}
if(CompareDate(timeOne,newdate)){
layer.alert(" ");
$(obj).val("");
return false;
}
if(CompareDate(timeTwo,newdate)){
layer.alert(" ");
$(obj).val("");
return false;
}
};
function CompareDate(d1,d2){
return ((new Date(d1.replace(/-/g,"\/"))) > (new Date(d2.replace(/-/g,"\/"))));
}
function CurentTime(){
var now = new Date();
var year = now.getFullYear(); //
var month = now.getMonth() + 1; //
var day = now.getDate(); //
var hh = now.getHours(); //
var mm = now.getMinutes(); //
var clock = year + "-";
if(month < 10) clock += "0";
clock += month + "-";
if(day < 10) clock += "0";
clock += day + " ";
if(hh < 10) clock += "0";
clock += hh + ":";
if (mm < 10) clock += '0';
clock += mm;
return(clock);
}
・