Fix: wrong checks editing ftDateTime

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2021 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
jujibo
2011-09-27 08:28:41 +00:00
parent bb2d88a299
commit e4f357ac35

View File

@ -174,7 +174,7 @@ end;
procedure TJDbGridDateTimeCtrl.myEditOnEditingDone(Sender: TObject);
begin
CellEditor.Caption := NormalizeDate(CellEditor.Caption, theValue);
CellEditor.Caption := NormalizeDateTime(CellEditor.Caption, theValue);
if Length(CellEditor.Caption) = 0 then
begin
Field.DataSet.Edit;
@ -183,11 +183,11 @@ begin
updated := True;
end
else
if IsValidDateString(CellEditor.Caption) then
if IsValidDateTimeString(CellEditor.Caption) then
begin
if (not updated) then
begin
theValue := StrToDate(CellEditor.Caption);
theValue := StrToDateTime(CellEditor.Caption);
Field.DataSet.Edit;
Field.AsDateTime := theValue;
end;