function myFunction() {
var str1 = "15.09.2012
19:30";
var str2 = new Date().format("dd.mm.yyyy");
var result = "";
var str3 = str1.substring(0, str1.indexOf(' ')); //str3= "15.09.2012"
var isEqual = str2.localeCompare(str3);
if (isEqual == 0)
result = str3 + ' and ' + str2 + ' are same!';
else
result = str3 + ' and ' + str2 + ' are different!';
}
Comments
Post a Comment