File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 60785
    
  65

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: 60785
    
  65

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: 60785
    
  65

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.
 
wood burning stoves
 
subject: How to get the end date based on start date and duration(in days) in jquery?
 
Similar Threads
How to calculate date from two fields
How to round up year duration.
AJAX & Frameworks
need help for critical path analysis in java
how to get duration starting date to ending date in visual jsf