how to calculate a future date

Posted by Self-Innovator under ASP.NET AJAX on 12/7/2012 | Points: 10 | Views : 935 | Status : [Member] | Replies : 3
hi,
I my case i have three text boxes dropdown,text1,text2...
in my dropdown if i select the value as 1 month,...
In text 1 i have an ajax calendar extender control if i select todays date 7/12/2012.. in text2 the value should automatically needs to be the fututre date of 1 month ie:7/1/2013...pls find me soln...

Join Hands Change lives
Thanks & Regards
Straight Edge Society



Responses

Posted by: Pavanandey on: 12/7/2012 [Member] Bronze | Points: 25

Up
0
Down
var currDate = new Date();
var currDay = currDate.getDate();
var currMonth = currDate.getMonth() + 1;
var currYear = currDate.getYear();
currDateStr = currMonth + "/" + currDay + "/" + currYear;
document.write(currDateStr);
document.write("<p>");
var ModMonth = currMonth + 1;
if (ModMonth > 12)
{
ModMonth = 1;
currYear = currYear + 1;
}

ModDateStr = ModMonth + "/" + currDay + "/" + currYear
document.write(ModDateStr);

you call this javascript function in the text changed event of the first text box


Thanks
Pavan Kumar
Mark Answer if this fits the need

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Self-Innovator on: 12/7/2012 [Member] Bronze | Points: 25

Up
0
Down
thanks dude...

Join Hands Change lives
Thanks & Regards
Straight Edge Society

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pavanandey on: 12/7/2012 [Member] Bronze | Points: 25

Up
0
Down
Mark the answer if this helps you

Thanks
Pavan Kumar
Mark Answer if this fits the need

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response