I've seen some applications that use a "holiday file" so that people can enter their own holidays. You can easily cook them up a 3 year file.
A lot of holidays are different around the world and there are a lot of holidays all tolled. On Thu, 12 Dec 2002, Anthony M. Humphreys wrote: > > Not quite, I was hoping to find the piece of code that would know if a given > date is/is not a holiday. > > Some holidays, like Christmas, are easy, they always occur on the same day > each year. > Some are almost easy, they occur on the x day of a month. > Some, like Easter/Good Friday, are somewhat complicated to calculate. > > Has anyone written Tango/Witango or JavaScript code to calculate holidays, > not to look them up from a DBMS? > Would you be willing to share with me/with the list? > > Anthony - > > > ----- Original Message ----- > From: "David Shelley" <[EMAIL PROTECTED]> > To: "Multiple recipients of list witango-talk" <[EMAIL PROTECTED]> > Sent: Thursday, December 12, 2002 00:41 > Subject: RE: Witango-Talk: Holiday Calculator > > > > Hi Anthony, > > > > I assume you want to find X business days from a certain date. I wrote > > something like that once. You still need to keep track of holidays in a > > table or array though. Here's the pseudo code. I'm sure you can write it > in > > Witango tags. :) > > > > populate an array of holidays > > counter = 0 > > endDate = startDate > > for 1 to some arbitrary high number (an @while tag would be nice here) > > if counter >= # of days then break > > endDate = endDate + 1 day > > if endDate is not Saturday or Sunday and not in holiday array then > > increment counter > > /for > > > > You can easily put it in a method, pass it the startDate and #of days, and > > have it return the endDate. > > > > Is that what you were looking for? > > > > Dave Shelley > > [EMAIL PROTECTED] > > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED]]On Behalf Of Anthony M. Humphreys > > Sent: Wednesday, December 11, 2002 7:48 PM > > To: Multiple recipients of list witango-talk > > Subject: Witango-Talk: Holiday Calculator > > > > > > Does anyone have a Tango/Witango or JavaScript Holiday calculator that > they > > are willing to share? > > > > I know about this: > > http://gethelp.devx.com/techtips/thesqlpro/10min/10min0201/10min0201.asp > > ..but this is a bit too clumsy for my purposes. > > > > I was hoping for a program that can calculate holidays, not a brute force > > method where I have to add all the dates and holidays into a table before > > hand. > > > > Anyone got some ideas? > > > > Anthony - > > > > > > ________________________________________________________________________ > > TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] > > with unsubscribe witango-talk in the message body > > > > ________________________________________________________________________ > > TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] > > with unsubscribe witango-talk in the message body > > ________________________________________________________________________ > TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] > with unsubscribe witango-talk in the message body > ________________________________________________________________________ TO UNSUBSCRIBE: send a plain text/US ASCII email to [EMAIL PROTECTED] with unsubscribe witango-talk in the message body
