[Haskell-beginners] Is there a function to determine if a date is
a business day?
andy.elvey at paradise.net.nz
Fri Dec 11 01:43:52 EST 2009
Colin Paul Adams wrote:
> You will need to write it, as it depends upon your definition of what
> a business day is.
> This tends to be country-specific (at least).
I'm a Haskell-newbie so I can't give the Haskell code for this, but in
"pseudo-code" it would be something like this -
holidays_list = ["09JAN", "06FEB", ..... ] ( This will vary depending
on country )
if myday not in holidays_list and day(myday) in ["Mon", "Tue", "Wed",
then business_day(myday) = "Yes"
else business_day(myday) = "No"
Some countries have a "Holidays Act" or similar legislation which
specifies the holidays for the current year and the next few years.
Hope this helps.... :)
More information about the Beginners