Click here to Skip to main content
15,913,854 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Calculating Variance excluding non-working days Pin
Alexander Wiseman2-Aug-04 7:14
Alexander Wiseman2-Aug-04 7:14 
GeneralProblem in playing MPEG-2 video in browser Pin
ckhjacky20-Jul-04 7:50
ckhjacky20-Jul-04 7:50 
Generalshould JMF be installed in all client PC Pin
karthik prasanna20-Jul-04 3:08
karthik prasanna20-Jul-04 3:08 
GeneralAdding number of days to a Date Pin
Ph@ntom19-Jul-04 20:34
Ph@ntom19-Jul-04 20:34 
GeneralRe: Adding number of days to a Date Pin
Alexander Wiseman20-Jul-04 4:29
Alexander Wiseman20-Jul-04 4:29 
GeneralRe: Adding number of days to a Date Pin
Ph@ntom20-Jul-04 16:59
Ph@ntom20-Jul-04 16:59 
GeneralRe: Adding number of days to a Date Pin
Ph@ntom20-Jul-04 19:13
Ph@ntom20-Jul-04 19:13 
GeneralRe: Adding number of days to a Date Pin
Alexander Wiseman21-Jul-04 3:31
Alexander Wiseman21-Jul-04 3:31 
Hey,

I tested the function today and realized I made a mistake in the calculate of weeks.

My line read var weeks = (numDays / 5);. When I wrote this I was thinking in C++ mode, thinking that the division operator would only return a whole number. In Javascript it returns the exact quotient, so we simply need to add the Math.floor function so it looks like this: var weeks = Math.floor(numDays / 5).

Give that a try and see if it works for you. Also, I ran across another problem in your section of the function. You have this line: var month = returnDate.getMonth() + numMonths + 1;. I think that the + 1 is unnecessary and returns the wrong date.

Make those two changes and it should be working for you! I didn't do extensive testing, so if you find any other strange scenarios which don't work, please tell me and I would be happy to correct the code.

Sincerely,
Alexander Wiseman

Est melior esse quam videri
It is better to be than to seem
GeneralRe: Adding number of days to a Date Pin
Ph@ntom23-Jul-04 17:48
Ph@ntom23-Jul-04 17:48 
GeneralRe: Adding number of days to a Date Pin
Alexander Wiseman25-Jul-04 3:22
Alexander Wiseman25-Jul-04 3:22 
GeneralRe: Adding number of days to a Date Pin
Ph@ntom25-Jul-04 6:16
Ph@ntom25-Jul-04 6:16 
GeneralRe: Adding number of days to a Date Pin
Ph@ntom26-Jul-04 6:12
Ph@ntom26-Jul-04 6:12 
GeneralRe: Adding number of days to a Date Pin
Alexander Wiseman27-Jul-04 8:00
Alexander Wiseman27-Jul-04 8:00 
GeneralRe: Adding number of days to a Date Pin
Ph@ntom27-Jul-04 19:40
Ph@ntom27-Jul-04 19:40 
GeneralRe: Adding number of days to a Date Pin
Alexander Wiseman28-Jul-04 4:31
Alexander Wiseman28-Jul-04 4:31 
GeneralRe: Adding number of days to a Date Pin
Ph@ntom30-Jul-04 18:57
Ph@ntom30-Jul-04 18:57 
GeneralRe: Adding number of days to a Date Pin
Alexander Wiseman2-Aug-04 7:15
Alexander Wiseman2-Aug-04 7:15 
GeneralCalling Web Services from a web page Pin
NiteShade19-Jul-04 6:36
NiteShade19-Jul-04 6:36 
GeneralRe: Calling Web Services from a web page Pin
VenkatFor.NET21-Jul-04 8:08
VenkatFor.NET21-Jul-04 8:08 
GeneralRe: Calling Web Services from a web page Pin
mysorian11-Aug-04 11:41
professionalmysorian11-Aug-04 11:41 
GeneralLocalHost and Browser Pin
ohdil16-Jul-04 8:41
ohdil16-Jul-04 8:41 
GeneralRe: LocalHost and Browser Pin
Javier Lozano18-Jul-04 17:01
Javier Lozano18-Jul-04 17:01 
GeneralRe: LocalHost and Browser Pin
ohdil22-Jul-04 13:40
ohdil22-Jul-04 13:40 
GeneralRe: LocalHost and Browser Pin
Javier Lozano22-Jul-04 14:18
Javier Lozano22-Jul-04 14:18 
GeneralGarbage Collection in JS Pin
abc87616-Jul-04 0:15
abc87616-Jul-04 0:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.