C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » JavaScript »

Javascript function to add days to date


Posted Date: 30 Oct 2009      Posted By: lakshya      Member Level: Gold     Points: 1   Responses: 2



i have a textbox with startdate and another textbox with noofnights , i need to calculate enddate ....

Happy dotneting Spread Smiles :-)
Visit Lakshya





Responses

Author: lakshya    30 Oct 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

well i have found the answers...
function checkDate(dt,days)
{
var d = new Date(dt);
var enddate='';
d.setDate(d.getDate() + days);
enddate=d.getMonth() + "/" + d.getDate() + "/" + d.getFullYear();
}

Happy dotneting Spread Smiles :-)
Visit Lakshya



Author: madhavi    30 Oct 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

<SCRIPT LANGUAGE="JAVASCRIPT">

var startdate=new Date("Oct 30,2009");



var nights=3
startdate.setDate(startdate.getDate()+nights);
document.write(startdate);


</script>



Post Reply
You must Sign In to post a response.
Next : Change IE Setting using JavaScript
Previous : Any alternate to isDate()
Return to Discussion Forum
Post New Message
Category: JavaScript

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use