[lazarus] TCalendar reporting wrong month...
Mattias Gaertner
nc-gaertnma at netcologne.de
Fri Apr 25 10:24:01 EDT 2003
On Fri, 25 Apr 2003 01:00:59 +0200
Tony Maro <tony at maro.net> wrote:
> Tony Maro wrote:
>
> > The TCalendar component DATE property is reporting one month behind
> > what the display shows, even in design mode.
>
> Found the problem in the GTK object interface for the TCalendar.
>
> TGtkObject.GetValue in gtkobject.inc even notes that the month field is
> zero based, but doesn't account for it. Recently changed... because it
> worked a few days ago.
>
> Here's what I did to my code - couldn't make a diff because the DNS
> servers serving freepascal.org are down.
>
> csCalendar :
> Begin
> gtk_calendar_get_date(PgtkCalendar(handle), at Year, @Month, @Day);
> //TODO: account for local settings like date format
> //Form some reason, the month is zero based.
> TLMCalendar(data^).Date := EncodeDate(Year,Month+1,Day);
> end;
>
> The "+1" after "Month" is what I added.
The cvs.freepascal is back again and I applied your +1.
Mattias
More information about the Lazarus
mailing list