Problems with TMonthCalendar since 1 september 2003.


2003-09-01 05:58:36 PM
delphi259
Hi guys
We've been using a TMonthCalendar from the Win32 section of Delphi5 for some
time now with no problems, however as of this morning we are getting some
wierd errors. These errors are also being reported by the users of the
application.
The component is used to highlight a selected date range. The code used to
set the date is below.
procedure TfmReportFilter.SetFromDate(const Value: TDateTime);
begin
FFromDate := Trunc(Value);
if (dtpFrom.DateTime <>trunc(value)) then dtpFrom.DateTime :=
trunc(value);
mcDateFilter.Date := Trunc(value);
// This is where it fails!!
if (FromDate>= ToDate) then ToDate := FromDate;
end;
procedure TfmReportFilter.SetToDate(const Value: TDateTime);
begin
FToDate := Trunc(Value)+1;
if (dtpTo.DateTime <>trunc(value)) then dtpTo.DateTime := trunc(value);
mcDateFilter.EndDate := Trunc(value);
if (FromDate>= ToDate) then FromDate := ToDate - 1;
end;
This was working, but as of today (well yesterday actually) we are getting
the error message "Failed to set calendar selected range" when executing the
line indicated above with a comment. The SetToDate function is not called.
This error occurs for every date since 30/8/2003. Prior to this date all is
fine.
Anyone? any suggestions?
Regards
Bryan