var txtSessionUID = document.getElementById('txtSessionUID')
var today = new Date();
var Year = today.getFullYear();
var Month = today.getMonth();
var Day = today.getDate();
var usetoDate = new Date(Year, Month, Day); // yyyy/mm/dd
var txtDate = document.getElementById('txtDate').value;
// var arrDate = txtDueDate.split("/");
// var useDate = new Date(arrDate[2], arrDate[1] - 1, arrDate[0]); // yyyy/mm/dd
var arrDate = txtDate.split("-");
var useDate = new Date(arrDate[0], arrDate[1] - 1, arrDate[2]); // yyyy/mm/dd
if (txtSessionUID.value != '') {
if (txtSessionUID.value == 13) {
if (useDate > usetoDate) {
alert("Date Should not Be Greater than to Today's Date..");
$find("txtDate").clear();
RPfFocus();
return false;
}
} else {
if (useDate > usetoDate) {
alert("Date Should not Be Greater than to Today's Date..");
$find("txtDate").clear();
RPfFocus();
return false;
}
if (useDate < usetoDate) {
alert("Date Should not Be Less than to Today's Date..");
$find("txtDate").clear();
RPfFocus();
return false;
}
}
}
}
}
var today = new Date();
var Year = today.getFullYear();
var Month = today.getMonth();
var Day = today.getDate();
var usetoDate = new Date(Year, Month, Day); // yyyy/mm/dd
var txtDate = document.getElementById('txtDate').value;
// var arrDate = txtDueDate.split("/");
// var useDate = new Date(arrDate[2], arrDate[1] - 1, arrDate[0]); // yyyy/mm/dd
var arrDate = txtDate.split("-");
var useDate = new Date(arrDate[0], arrDate[1] - 1, arrDate[2]); // yyyy/mm/dd
if (txtSessionUID.value != '') {
if (txtSessionUID.value == 13) {
if (useDate > usetoDate) {
alert("Date Should not Be Greater than to Today's Date..");
$find("txtDate").clear();
RPfFocus();
return false;
}
} else {
if (useDate > usetoDate) {
alert("Date Should not Be Greater than to Today's Date..");
$find("txtDate").clear();
RPfFocus();
return false;
}
if (useDate < usetoDate) {
alert("Date Should not Be Less than to Today's Date..");
$find("txtDate").clear();
RPfFocus();
return false;
}
}
}
}
}
No comments:
Post a Comment