There is no easy way man. best you can do is to find a JavaScript date
library that already exists. Try the forums on java.net. Its way too
much work to write a date handeler library yourself and its probably
been done before.;

Harsh.

-----Original Message-----
From: Abhimanyu Koul [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 25, 2006 7:22 AM
To: Struts Users Mailing List
Subject: Re: number of days


thanks.
but i am really looking for a way to do this on the client side.
any idea?

Abhimanyu Koul
FinEng Solutions (P)  Ltd.
Dani Compound,
158, Vidyanagari Marg,
Kalina, Santacruz (East),
Mumbai - 400 098
Mobile : +91 9860582533
----- Original Message -----
From: "Bart Busschots" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Thursday, May 25, 2006 5:34 PM
Subject: Re: number of days


> This isn't a struts question but anyway, assuming you want to do this
on
> the server side and not on the client side (you'd be mad to do it on
the
> client side) the java Date related utility classes will be able to
help
> you out (java.util.Calendar, java.util.GregorialCalendar,
java.util.Date).
>
> The way I would do it would be something like this:
> 1) Create a counter to hold your total
> 2) Create a date for your start time and for your end time
> 3) Convert the date for your start time to a Calendar
> Write a while loop something like:
>
> while(startDate.before(EndDate)){
>    if(startDate is a Sunday){
>        ; file://do nothing
>    }if(startDate is a Saturday){
>       total += 0.5;
>    }else{
>       total += 1.0;
>    }
>    file://add a day to the Start Date
> }
>
> HTH, Bart.
>
> Abhimanyu Koul wrote:
> > hi!
> > i am really struggling to find a  way to calculate number of days
between two dates in mm/dd/yyyy which i get using javascript popup
calendars.  excluding sundays and half saturdays.
> > the number of days i have to record in the database.
> > please help
> >
> > Abhimanyu Koul
> > FinEng Solutions (P)  Ltd.
> > Dani Compound,
> > 158, Vidyanagari Marg,
> > Kalina, Santacruz (East),
> > Mumbai - 400 098
> > Mobile : +91 9860582533
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to