TeeRoundDate -> smaller interval than half-month
Posted: Mon Mar 05, 2007 2:08 pm
I need day and week intervals.
So I had to add:
if AStep<dtHalfMonth then
begin
Case AStep of
dtOneDay: result:=round(ADate);
dtTwoDays: result:=round(ADate/2.0)*2;
dtThreeDays: result:=round(ADate/3.0)*3;
dtOneWeek: result:=2.0+round((ADate-2.0)/7.0)*7;
else result:=ADate;
end;
end
else
begin
DecodeDate(ADate,Year,Month,Day);
Case AStep of ... (original code)
Apart from that, TeeRoundDate is (also) unable to round dates before 1-1-1900. Can you fix this please?
So I had to add:
if AStep<dtHalfMonth then
begin
Case AStep of
dtOneDay: result:=round(ADate);
dtTwoDays: result:=round(ADate/2.0)*2;
dtThreeDays: result:=round(ADate/3.0)*3;
dtOneWeek: result:=2.0+round((ADate-2.0)/7.0)*7;
else result:=ADate;
end;
end
else
begin
DecodeDate(ADate,Year,Month,Day);
Case AStep of ... (original code)
Apart from that, TeeRoundDate is (also) unable to round dates before 1-1-1900. Can you fix this please?