ajst 18 Junior Poster

Hi Guys and girls,

I'm using a TMonthCalander to display Dates, I'm using the BoldDays method to bold the important days.

I have everything working fine when the user changes the month via the TMonthCalander controls.

But I can not bold the days when they click a button.

I've tried calling the GetMonthInfo method manually but it does not bold the days. It is finding the correct days to Bold but does not Bold them. As soon as I change the month on the calendar it starts bolding the correct days again.

Thanks in advance for any help.

// my GetMonthInfo method which is assigned to my TMonthCalander called da
procedure TChangeRepeatBooking.daGetMonthInfo(Sender: TObject; Month: Cardinal;
  var MonthBoldInfo: Cardinal);
startDate  : TSysDate;
finishDate : TSysDate;
boldDays   : array[1..31] of cardinal;

startDate := DateTimeToSysDate(StartDatePicker.Date);
finishDate := DateTimeToSysDate(FinishDatePicker.Date);

  while TimeDiff(@startDate,@FinishDate) >= 0 do
    if (CheckDays(DayOfWeek(SysDateToDateTime(startDate)))) and (MonthOf(SysDateToDateTime(startDate)) = Month) then
      boldDays[DayOfTheMonth(SysDateToDateTime(startDate))] := DayOfTheMonth(SysDateToDateTime(startDate));
    else if (MonthOf(SysDateToDateTime(startDate)) = Month) then
       boldDays[DayOfTheMonth(SysDateToDateTime(startDate))] := 0;

  da.BoldDays( boldDays,MonthBoldInfo);
  cardinalMonthBold := MonthBoldInfo;


//when they click a button it calls this method like so
cardinalMonth := MonthOf(da.date);

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.