function getNextScheduledDate() {
var date = document.getElementById('<%= txtDate.ClientID %>');
var arry = new Array();
arry[1] = document.getElementById('<%=txtDate.ClientID %>').value;
var ArrDoj = arry[1].split("/");
var myDate = new Date(ArrDoj[2], ArrDoj[1], ArrDoj[0]);
//get month and add three month
myDate.setMonth(myDate.getMonth() + 3);
//get date
var strday = myDate.getDate(); //.getDay();
var strMonth = myDate.getMonth();
//get year
var strYear = myDate.getFullYear();
VarifyMonth(strMonth, strYear, strday);
}
function VarifyMonth(currMonth, currYear, CurrDay) {
if (currMonth > 12) {
currMonth = 1;
currYear = currYear + 1;
}
// var ModDay;
// if (getNumFebDays(currYear) == 28 && currMonth == 2) {
// ModDay = 3;
// }
// if (getNumFebDays(currYear) == 29 && currMonth == 2) {
// ModDay = 2;
// }
ModDateStr = CurrDay + "/" + currMonth + "/" + currYear;
document.getElementById('<%=txtNextScheduleDate.ClientID %>').value = ModDateStr;
}
function getNumFebDays(theYear) // calc num days in February
{
if ((theYear % 4 == 0 && theYear % 100 != 0) || theYear % 400 == 0)
return 29;
else
return 28;
}
var date = document.getElementById('<%= txtDate.ClientID %>');
var arry = new Array();
arry[1] = document.getElementById('<%=txtDate.ClientID %>').value;
var ArrDoj = arry[1].split("/");
var myDate = new Date(ArrDoj[2], ArrDoj[1], ArrDoj[0]);
//get month and add three month
myDate.setMonth(myDate.getMonth() + 3);
//get date
var strday = myDate.getDate(); //.getDay();
var strMonth = myDate.getMonth();
//get year
var strYear = myDate.getFullYear();
VarifyMonth(strMonth, strYear, strday);
}
function VarifyMonth(currMonth, currYear, CurrDay) {
if (currMonth > 12) {
currMonth = 1;
currYear = currYear + 1;
}
// var ModDay;
// if (getNumFebDays(currYear) == 28 && currMonth == 2) {
// ModDay = 3;
// }
// if (getNumFebDays(currYear) == 29 && currMonth == 2) {
// ModDay = 2;
// }
ModDateStr = CurrDay + "/" + currMonth + "/" + currYear;
document.getElementById('<%=txtNextScheduleDate.ClientID %>').value = ModDateStr;
}
function getNumFebDays(theYear) // calc num days in February
{
if ((theYear % 4 == 0 && theYear % 100 != 0) || theYear % 400 == 0)
return 29;
else
return 28;
}
10:59 PM |
Category: |
0
comments
Comments (0)