aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes How to get the end date based on start date  and duration(in days) in jquery? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to get the end date based on start date  and duration(in days) in jquery?" Watch "How to get the end date based on start date  and duration(in days) in jquery?" New topic
Author

How to get the end date based on start date and duration(in days) in jquery?

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

How to get the end date based on start date and duration in jquery?.

I tried googling it most of the resolution was to get the duration for start date and end date.Please advice.


http://www.lifesbizzare.blogspot.com || OCJP:81%
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

You wouldn't use jQuery for this. Why would you use jQuery to manipulate a Date?

Everything you need is in the Date object. Look at the APi and give the code a try. Then post with your code if you still have questions.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

I tried with the below code


Please advice where I am going wrong?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

Open the browser debugger and step through the code. Does each line do what you think it does?

Hint: the value of form controls are strings.
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

Bear Bibeault wrote:Open the browser debugger and step through the code. Does each line do what you think it does?

Hint: the value of form controls are strings.



I need to typecast into Date?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61413
    
  67

There is no such thing is typecasting in JavaScript. If you want to be able to perform numerical math on string values, they'll need to be converted to numbers. You will find the necessary methods on the window object.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get the end date based on start date and duration(in days) in jquery?