var yugi = function(str1, str2){
var reg = /[^\d]+/;
var arr1 = str1.split(reg);
var arr2 = str2.split(reg);
var d1 = new Date(arr1[0],arr1[1],arr1[2]);
var d2 = new Date(arr2[0],arr2[1],arr2[2]);
return d1 - d2;
}
if(yugi("2015-10-16", "2015-10-18") < 0){
console.log("<");
}else if...
else...