From a90fe39ab98e8851dbfdb185bd5cefa7c71e1b33 Mon Sep 17 00:00:00 2001 From: alexs75 Date: Wed, 11 Oct 2017 11:14:29 +0000 Subject: [PATCH] RxFPC:TRxDBTimeEdit fix clear date part of field values on change git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6036 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/rx/trunk/rxdb/rxdbtimeedit.pas | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/rx/trunk/rxdb/rxdbtimeedit.pas b/components/rx/trunk/rxdb/rxdbtimeedit.pas index 49d45e012..4deb466f7 100644 --- a/components/rx/trunk/rxdb/rxdbtimeedit.pas +++ b/components/rx/trunk/rxdb/rxdbtimeedit.pas @@ -67,7 +67,6 @@ type procedure SetReadOnly(AValue: Boolean);override; property DataField: string read GetDataField write SetDataField; property DataSource: TDataSource read GetDataSource write SetDataSource; - //property ReadOnly: Boolean read GetReadOnly write SetReadOnly default False; procedure KeyDown(var Key: Word; Shift: TShiftState); override; procedure Change; override; @@ -192,10 +191,13 @@ begin end; procedure TCustomRxDBTimeEdit.UpdateData(Sender: TObject); +var + D: Int64; begin if Assigned(FDataLink.Field) and (FDataLink.Field.DataType in DataTimeTypes) then begin - FDataLink.Field.AsDateTime := Self.Time; + D:=trunc(FDataLink.Field.AsDateTime); + FDataLink.Field.AsDateTime := D + Self.Time; end; end;