Subject Re: [IBO] Display problem in TIB_DateTimePicker
Author Mark Pickersgill
Hi Salvatore,
I've just traced through the TIB_DateTimePicker and discovered it
doesn't quite cater for Time as well as it should.
Without too much thought, I managed the following hack to get the time
value updating correctly when setting the field data.

in IBC_DateTimePicker.IMP line 64, where it reads:
Date := StrToDateTime( FieldText );

Replace it with:
if Kind = dtkTime then
Time := StrToDateTime( FieldText )
Date := StrToDateTime( FieldText );

By the look of the component, and the comments, I'm guessing that
earlier Delphi implementations had the one "Date" property to handle
Date and Time, whereas later Delphi implementations have separate "Date"
and "Time" properties, but the component was never updated...but I could
be wrong. :)

At a quick glance, there's a few other places where the above (or like)
fix could go.

I'll forward the email to Jason as well to let him know. If time
permits, I'll dig a little deeper.


Salvatore Besso wrote:

>hello all,
>second post.
>I have found no way to have this component to display the value assigned to
>its field. The field in the Firebird database is defined as TIME (no date).
>The picker Kind is dtkTime.
>When at runtime I assign
> Query.FieldByName('TIME_FIELD').AsDateTime := Now
>the database field has of course the correct value, but the picker doesn't
>display it, showing always the value assigned at design time in the object
>inspector. But notice that the same component used with Kind = dtkDate
>works fine and it displays the correct value after having assigned one to
>its field.
>Any hints?