Hi all !

I am trying to find a way to display the previous business date.

Currently I have this :

Clip.setpaste(formatdate("MM",date)++"/"++formatdate("dd",date-1)
++"/"++formatdate("yyyy",date))

which shows the date as I need it, in the format MM/dd/YYYY.

This shows date-1, however the problem is that this is not
considering that going back from the 1st of a month the previous
date would have to be the 30th/31st (Jan,Mar-Dec) and 28th/29th for
February, therefore month-1 should displayed and based on which 
month's 1st is entered the respective previous month has to be 
derived.

I basically need a "smart" date calculation that correctly determins 
which the previous month actually is and how many days it has, 
therefore also considering Leap years for the month of February.

It has also has to know that when running this command on a Monday, 
the previous business day would be a Friday, or even being able to 
add a list of holidays that are looked up when the friday is a 
holiday.

I looked into the date plugin but couldn't find a proper way to do
what I am looking for.

Any idea how I can get this set up ? Any help is much appreciated.

Cheers


Reply via email to