Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Add 10 working days.
- From: javascript@xxxxxxxxxx (BEKIM BACAJ)
- Subject: [Javascript] Add 10 working days.
- Date: Wed, 25 Sep 2002 03:59:05 +0000
Well,
very nice solution. Fast and creative - I like that!
thank's for repply. (keep on the good work, it will pay back:)
>From: Andrew Dunn <andrew@xxxxxxxxxx>
>Reply-To: javascript@xxxxxxxxxx
>To: "'javascript@xxxxxxxxxx'" <javascript@xxxxxxxxxx>
>Subject: RE: [Javascript] Add 10 working days.
>Date: Wed, 25 Sep 2002 13:36:04 +1000
>
>I made my own solution to the problem, here is the function:
>
> function addWorkingDays(myDate,days) { //myDate = starting
>date, days = no. working days to add.
> var temp_date = new Date();
> var i = 0;
> var days_to_add = 0;
> while (i < (days)){
> temp_date = new Date(myDate.getTime() +
>(days_to_add*24*60*60*1000));
> //0 = Sunday, 6 = Saturday, if the date not
>equals a weekend day then increase by 1
> if ((temp_date.getDay() != 0) &&
>(temp_date.getDay() != 6)){
> i+=1;
> }
> days_to_add += 1;
> }
> return new Date(myDate.getTime() +
>days_to_add*24*60*60*1000);
> }
>
>
>
>-----Original Message-----
>From: BEKIM BACAJ [mailto:trojani2000@xxxxxxxxxxx]
>Sent: Wednesday, 25 September 2002 11:40 AM
>To: javascript@xxxxxxxxxx
>Subject: Re: [Javascript] Add 10 working days.
>
>
>If I understood the problem correctly, you have to extract the weekends or
>ad the number of days that fallitno the weekend of this 10 day
>prolongation.
>
>The number wary from 2 - 4 so you have to find out what day of the week the
>user entered the textbox so you can decide how many days to add. (hollyday
>date may also cause some additional probs)
>this would be all for now. Cheers!
>
>
> >From: Andrew Dunn <andrew@xxxxxxxxxx>
> >Reply-To: javascript@xxxxxxxxxx
> >To: "'javascript@xxxxxxxxxx'" <javascript@xxxxxxxxxx>
> >Subject: [Javascript] Add 10 working days.
> >Date: Wed, 25 Sep 2002 11:13:04 +1000
> >
> >I need to add 10 working days to a date the user enters in to a text
> >box.
> >At
> >the moment I'm using this function:
> >
> >function addDays(myDate,days) {
> > return new Date(myDate.getTime() +
> >days*24*60*60*1000);
> > }
> >
> >This adds the number of days, but it doesn't exclude weekends. Anyone
> >have any suggestions for this?
> >
> >Thanks.
> >_______________________________________________
> >Javascript mailing list
> >Javascript@xxxxxxxxxx
> >https://lists.LaTech.edu/mailman/listinfo/javascript
>
>
>
>
>_________________________________________________________________
>Join the world's largest e-mail service with MSN Hotmail.
>http://www.hotmail.com
>
>_______________________________________________
>Javascript mailing list
>Javascript@xxxxxxxxxx https://lists.LaTech.edu/mailman/listinfo/javascript
>_______________________________________________
>Javascript mailing list
>Javascript@xxxxxxxxxx
>https://lists.LaTech.edu/mailman/listinfo/javascript
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
- Prev by Date: [Javascript] Add 10 working days.
- Next by Date: [Javascript] Javascript Question
- Previous by thread: [Javascript] Add 10 working days.
- Next by thread: [Javascript] Javascript Question
- Index(es):