procedure TFormprincipal.MonthCalendar1GetMonthInfo(Sender: TObject;
Month: Cardinal; var MonthBoldInfo: Cardinal);
var
dias :array of cardinal;
DATA,DATENOW :TDATETIME;
begin
DM.Q_bold.CLOSE;
DM.Q_bold.SQL.CLEAR;
DM.Q_bold.SQL.TEXT:='SELECT DISTINCT DATA FROM TB_agenda';
DM.Q_bold.OPEN;
DM.Q_bold.FIRST;
WHILE NOT DM.Q_bold.EOF DO
BEGIN
DATA:=DM.Q_bold.FIELDBYNAME('DATA').AsDateTime;
SetLength(dias,DM.Q_bold.RECORDCOUNT);
DATENOW:= STRTOINT(FORMATDATETIME('MM',DATA));
if month = DATENOW THEN
BEGIN
MonthBoldInfo:=0;
dias[DM.Q_negrito.RECNO-1]:= STRTOINT(FORMATDATETIME('DD',DATA));
MonthCalendar1.BoldDays(dias,MonthBoldInfo);
END;
DM.Q_bold.Next;
end;
end;