home *** CD-ROM | disk | FTP | other *** search
- TAdrockDate Class History File
- ==============================
-
- 1st March, 1996 Version 1.00
-
- NEW & UPDATED FEATURES
- ----------------------
- Initial Release to Compuserve.....
-
- 8th March, 1996 Version 1.10
-
- NEW & UPDATED FEATURES
- ----------------------
- Added some Business and Holiday Routines..
-
- Function IsDateWithinRange(TestDate, FirstDate, LastDate : TDatetime) : Boolean;
- Function NextBusinessDay(RequiredDate : TDateTime) : TDateTime;
- Function PrevBusinessDay(RequiredDate : TDateTime) : TDateTime;
- Function ReturnBusinessDaysBetweenDates(FirstDate, LastDate : TDatetime) : Integer;
- Function VerbalDate(WorkDate : TDatetime) : String;
-
- Function IsMonday(WorkDate : TDateTime) : Boolean;
- Function IsTuesday(WorkDate : TDateTime) : Boolean;
- Function IsWednesday(WorkDate : TDateTime) : Boolean;
- Function IsThursday(WorkDate : TDateTime) : Boolean;
- Function IsFriday(WorkDate : TDateTime) : Boolean;
- Function IsSaturday(WorkDate : TDateTime) : Boolean;
- Function IsSunday(WorkDate : TDateTime) : Boolean;
-
- Function IsJanuary(WorkDate : TDateTime) : Boolean;
- Function IsFebruary(WorkDate : TDateTime) : Boolean;
- Function IsMarch(WorkDate : TDateTime) : Boolean;
- Function IsApril(WorkDate : TDateTime) : Boolean;
- Function IsMay(WorkDate : TDateTime) : Boolean;
- Function IsJune(WorkDate : TDateTime) : Boolean;
- Function IsJuly(WorkDate : TDateTime) : Boolean;
- Function IsAugust(WorkDate : TDateTime) : Boolean;
- Function IsSeptember(WorkDate : TDateTime) : Boolean;
- Function IsOctober(WorkDate : TDateTime) : Boolean;
- Function IsNovember(WorkDate : TDateTime) : Boolean;
- Function IsDecember(WorkDate : TDateTime) : Boolean;
-
- Function IsWeekend(WorkDate : TDateTime) : Boolean;
- Function IsWeekday(WorkDate : TDateTime) : Boolean;
-
- Function IsAM(WorkDate : TDateTime) : Boolean;
- Function IsPM(WorkDate : TDateTime) : Boolean;
- Function IsMorning(WorkDate : TDateTime) : Boolean;
- Function IsAfternoon(WorkDate : TDateTime) : Boolean;
-
- Function IsMidday(WorkDate : TDateTime) : Boolean;
- Function IsMidNight(WorkDate : TDateTime) : Boolean;
-
- Function IsChristmasDay(WorkDate : TDateTime) : Boolean;
- Function IsNewYearsDay(WorkDate : TDateTime) : Boolean;
-
- Function IsFirstOfTheMonth(WorkDate : TDateTime) : Boolean;
- Function IsLastOfTheMonth(WorkDate : TDateTime) : Boolean;
- Function IsBusinessDay(WorkDate : TDateTime) : Boolean;
- Function IsDateInPosNegRange(WorkDate, CompareDate : TDateTime; PositiveDays,
- NegativeDays : Integer) : Boolean;
- Function IsDateInPosNegBusinessRange(WorkDate, CompareDate : TDateTime; PositiveDays,
- NegativeDays : Integer) : Boolean;
- Function AddBusinessDays(NumberOfDays : Integer; WorkDate :TDateTime) : TDateTime;
-
- Function IsHoliday(WorkDate : TDateTime) : Boolean;
- Function IsBusinessHoliday(WorkDate : TDateTime) : Boolean;
- Procedure SetHolidayStringList(NewHolidayStringList : TStrings);
-
- 9th April, 1996 Version 1.20
-
- NEW & UPDATED FEATURES
- ----------------------
- Added function IsEmpty() which tests for an empty date string being passed.
- Added function ReturnFirstOfAWeek() which will return the date for the first day of
- the week for any starting week day.
- Added function ReturnLastOfAWeek() which will return the date for the last day of the
- week for any starting week day.
-
- All the functions in the class can now be called directly without having to declare a
- TAdrockDate variable. All the functions have the same names, and parameters as they do
- in the class.
-
- Below is how you USE TO HAVE to call the routines..
-
- Uses AdDate;
-
- procedure TTestForm.Button1Click(Sender: TObject);
- Var
- AdDate : TAdrockDates
- IsValid : Boolean;
- begin
- AdDate := TAdrockDates.Create;
- IsValid := AdDate.IsValidDate('55/55/96');
- AdDate.Free;
- end;
-
- Below is the NEWER EASIER way to call the routines in the class.....
-
- Uses AdDate;
-
- procedure TTestForm.Button1Click(Sender: TObject);
- Var
- IsValid : Boolean;
- begin
- { !! IsValidDate returns true or false, it never causes an exception !!}
- IsValid := IsValidDate('55/55/96');
- end;
-
- 13th June, 1996 Version 1.30
-
- BUG FIX'S & MODIFICATIONS
- --------------------------
- We have fixed a bug (Not Ours) that hopefully not many people have seen.
-
- The problem occurs only during linking and the error is:
-
- Error(0) : Overflow in conversion or arithmetic operation
-
- After talking to Borland Tech Support in Sydney,Austrailia we were no better off, but
- after searching around the WEB we found a fix for it.
-
- We thank Duncan Murdock that submitted the bug and fix for it to the web site
- (http://www.DataWeb.nl/~r.p.Sterkenburg/bugs2 )
-
- The error is definitly a BORLAND DELPHI COMPILER / LINKER ERROR.
-
- The code below will reproduce the bug.
- ***********************************
-
- Unit ConstBug;
-
- Interface
-
- Const
- c1 = 1.0;
- c2 = 2.0;
-
- Implementation
-
- end.
-
- ***********************************
- Mr Murdock states, just add this unit to a project and make it twice. On the second
- make when ConstBug.DCU is just being linked( Not Compiled) you should get the error.
- (I tried it and it did not fail) but it did definitly prove that the error is produced
- when using floating point constants. I added 3 floating point constants to our
- AdDate.PAS and when it did fail I had 3 error(0)'s.
-
- When the ConstBug code above does fail you will get 2 error (0)'s.
-
- We will be informing Borland Tech Support of this bug and fix.
-
- The FIX?, use Typed Constants rather than UnTyped Constants.
-
- Instead of c1 = 1.0; Use c1 : Single = 1.0;
-
- 28th June, 1996 Version 1.40
-
- BUG FIX'S & MODIFICATIONS
- --------------------------
- There was a bug in a routine that checks for leap years. I had the leap year checking
- routine calling IsLeapYear(TDateTime) when it should have been calling
- IsLeapYearI(Integer).
-
- 4th July, 1996 Version 1.50
-
- BUG FIX'S & MODIFICATIONS
- --------------------------
- There was a bug in the FormatDate routine, the bug would only occur if you used the
- special Z parameter to put the week day st, nd, rd, or th into the return string.The
- bug was I was calling ReturnDayTH() instead of ReturnDayTHi().
-
- 19th July, 1996 Version 1.60
-
- BUG FIX'S & MODIFICATIONS
- --------------------------
- Fixed a bug in the week number calculation routines, some weeks on the year boundry
- would state the wrong week, all other weeks were fine.
-
- 8th August, 1996 Version 1.70
-
- BUG FIX'S & MODIFICATIONS
- --------------------------
- There was a bug in the AddBusinessDays function when using negative dates. The date
- would not decrement when using negative values. The bug was the result of not using
- ABS() around the number of days so it would work with either posative or negative
- values.
-
- 14th August, 1996 Version 1.80
-
- BUG FIX'S & MODIFICATIONS
- --------------------------
- Correct a problem in the AddMonths() function when using negative dates like -9.
-
- Adrock Software, Byte Computer & Software Ltd
- CompuServe 770135,110 Internet ADROCK@USA.NET
- http://WWW.MailHost.Net/~Byte
-
- 2nd September, 1996 02:27 PM
-