On Sat, 11 Sep 2004, Sean Schofield wrote:

> adjustForWeekends(Date):Date

> a weekend, the managers want to know and plan accordingly.  The
> adjustForWeekends method will move the original date backwards until it is
> no longer a weekend.

I would think that, in general, you would want the ability to adjust dates
either forward or backward for weekends.  I.e. "1st weekday of the month"
or "last weekday of the month".  "15th of the month, adjusted" might go
either way.

Probably two methods, "adjustForwardToWeekday()" and
"adjustBackwardToWeekday", although alternately "nextWeekday" and
"previousWeekday" could work, with
  Date adjustForwardToWeekday(Date d) {
    Date n = d.nextWeekday();
    return n.previousWeekday().equals(d) ? d : n;
  }
etc.
 --scott

Panama Sugar Grove Yakima KUPALM supercomputer ODYOKE AEFOXTROT Mossad
   Register to vote!  http://www.yourvotematters.org/VerifiedVoting
                         ( http://cscott.net/ )

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

Reply via email to