Skip to content

Commit

Permalink
Foi adicionado verificação para o tipo ftDateTime em Bind4D.Component…
Browse files Browse the repository at this point in the history
….DateTimePicker.pas

Foi corrigido a rotina que atribui o valor ao Edit em Bind4D.Component.Edit.pas
  • Loading branch information
juliocandrade committed Jan 20, 2022
1 parent 613f66b commit cc2db24
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/Bind4D.Component.DateTimePicker.pas
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,17 @@ function TBind4DComponentDateTimePicker.ApplyValue: iBind4DComponent;
begin
Result := Self;
case FAttributes.FieldType of
ftDate,
ftDateTime :
begin
FComponent.DateTime := TBind4DUtils.FormatStrJsonToDateTime(FAttributes.ValueVariant);
end;
ftDate :
begin
FComponent.Date := TBind4DUtils.FormatStrJsonToDateTime(FAttributes.ValueVariant);
end;
ftTime :
begin
FComponent.Date := TBind4DUtils.FormatStrJsonToTime(FAttributes.ValueVariant);
FComponent.Time := TBind4DUtils.FormatStrJsonToTime(FAttributes.ValueVariant);
end;
end;
end;
Expand Down
5 changes: 4 additions & 1 deletion src/Bind4D.Component.Edit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ function TBind4DComponentEdit.ApplyText: iBind4DComponent;
FComponent.Text := FAttributes.ValueVariant;
end;
function TBind4DComponentEdit.ApplyValue: iBind4DComponent;
var
VariantD : Double;
begin
Result := Self;
if VarIsNull(FAttributes.ValueVariant) then exit;
Expand Down Expand Up @@ -133,7 +135,8 @@ function TBind4DComponentEdit.ApplyValue: iBind4DComponent;
ftFloat,
ftCurrency:
begin
FComponent.Text := FloatToStr(FAttributes.ValueVariant);
VariantD := FAttributes.ValueVariant;
FComponent.Text := format('%n', [VariantD]);
end;
end;
end;
Expand Down

0 comments on commit cc2db24

Please sign in to comment.