Subject | Re: [IBO] only time in a TDBGrid |
---|---|
Author | Helen Borrie |
Post date | 2002-08-27T00:35:16Z |
At 07:54 PM 26-08-02 +0000, you wrote:
respectively in the Delphi help (not sure if D3 supports EditMask). If the
grid is editable, you will have to set both.
But in the VCL grid I'm not sure you could have an input field that accepts
a TDateTime through a mask that collects only the hours and minutes. You
would need to set up a format string for the mask, that always puts zeros
into the year, month, day and second slots. Masks use the same syntax as
Format(). (see the Help entry 'Format strings'.) Even so, to store the time
correctly in a TIME type (dialect 3 only) I think you might need to write
your own in-place editor or BeforePost handler, using DecodeDate and
EncodeDate, to arrive at a valid time literal...
The TDateTimePicker has a Format property but D3 might not have this control.
Helen
>I use D3 and IBO3.See the DisplayMask and EditMask properties of TDateTimeField and TField
>
>I have a bus schedule stored in a table.
>
>Departures and arrivals are timestamp fields.
>
>When I edit the fields in a TDBTable, data appear as
>
>30/12/99 6.25.00
>
>This is unwanted.
>
>I'd like it to appear (and be edited) in the format hh:mm, i.e.
>
>6:25 (6.25 would be ok, too).
>
>How can I change the format a timestamp is displayed/edited in a
>TDBTable ?
respectively in the Delphi help (not sure if D3 supports EditMask). If the
grid is editable, you will have to set both.
But in the VCL grid I'm not sure you could have an input field that accepts
a TDateTime through a mask that collects only the hours and minutes. You
would need to set up a format string for the mask, that always puts zeros
into the year, month, day and second slots. Masks use the same syntax as
Format(). (see the Help entry 'Format strings'.) Even so, to store the time
correctly in a TIME type (dialect 3 only) I think you might need to write
your own in-place editor or BeforePost handler, using DecodeDate and
EncodeDate, to arrive at a valid time literal...
The TDateTimePicker has a Format property but D3 might not have this control.
Helen