We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A classe não publica as propriedades "FormatTime" e "FormatDateTime"
segue modificações necessárias:
-- Config.pas
TDataSetSerializeConfigExport = class private FExportNullValues: Boolean; FExportNullAsEmptyString: Boolean; FExportOnlyFieldsVisible: Boolean; FExportEmptyDataSet: Boolean; FFormatCurrency: string; FFormatDate: string; FFormatTime: string; FFormatDateTime: string; FExportChildDataSetAsJsonObject: Boolean; public constructor Create; property FormatTime: string read FFormatTime write FFormatTime; property FormatDateTime: string read FFormatDateTime write FFormatDateTime; property FormatDate: string read FFormatDate write FFormatDate; property FormatCurrency: string read FFormatCurrency write FFormatCurrency; property ExportOnlyFieldsVisible: Boolean read FExportOnlyFieldsVisible write FExportOnlyFieldsVisible; property ExportNullValues: Boolean read FExportNullValues write FExportNullValues; property ExportNullAsEmptyString: Boolean read FExportNullAsEmptyString write FExportNullAsEmptyString; property ExportEmptyDataSet: Boolean read FExportEmptyDataSet write FExportEmptyDataSet; property ExportChildDataSetAsJsonObject: Boolean read FExportChildDataSetAsJsonObject write FExportChildDataSetAsJsonObject; end;
constructor TDataSetSerializeConfigExport.Create; begin FExportNullValues := True; FExportNullAsEmptyString:= False; FExportOnlyFieldsVisible := True; ExportEmptyDataSet := False; FFormatCurrency := EmptyStr; FFormatTime := 'hh:nn:ss.zzz'; FFormatDateTime := 'yyyy-mm-dd hh:nn:ss.zzz'; FFormatDate := 'YYYY-MM-DD'; FExportChildDataSetAsJsonObject := False; end;
-- Export.pas
TFieldType.ftDateTime: Result.{$IF DEFINED(FPC)}Add{$ELSE}AddPair{$ENDIF}(LKey, TJSONString.Create(FormatDateTime(TDataSetSerializeConfig.GetInstance.Export.FormatDateTime, LField.AsDateTime))); TFieldType.ftTimeStamp: Result.{$IF DEFINED(FPC)}Add{$ELSE}AddPair{$ENDIF}(LKey, TJSONString.Create(DateToISO8601(LField.AsDateTime, TDataSetSerializeConfig.GetInstance.DateInputIsUTC))); TFieldType.ftTime: Result.{$IF DEFINED(FPC)}Add{$ELSE}AddPair{$ENDIF}(LKey, TJSONString.Create(FormatDateTime(TDataSetSerializeConfig.GetInstance.Export.FormatTime, LField.AsDateTime))); TFieldType.ftDate: Result.{$IF DEFINED(FPC)}Add{$ELSE}AddPair{$ENDIF}(LKey, TJSONString.Create(FormatDateTime(TDataSetSerializeConfig.GetInstance.Export.FormatDate, LField.AsDateTime)));
The text was updated successfully, but these errors were encountered:
Obrigado
Sorry, something went wrong.
DateTime and Time format configuration #82
c15fdd8
Samples configuration delphi with FormatTime and FormatDateTime #82
d0ad5e2
Samples configuration lazarus with FormatTime and FormatDateTime #82
14893af
Merge pull request #86 from juliosenha/master
48aa359
back to changes made to issue #82
No branches or pull requests
A classe não publica as propriedades "FormatTime" e "FormatDateTime"
segue modificações necessárias:
-- Config.pas
TDataSetSerializeConfigExport = class
private
FExportNullValues: Boolean;
FExportNullAsEmptyString: Boolean;
FExportOnlyFieldsVisible: Boolean;
FExportEmptyDataSet: Boolean;
FFormatCurrency: string;
FFormatDate: string;
FFormatTime: string;
FFormatDateTime: string;
FExportChildDataSetAsJsonObject: Boolean;
public
constructor Create;
property FormatTime: string read FFormatTime write FFormatTime;
property FormatDateTime: string read FFormatDateTime write FFormatDateTime;
property FormatDate: string read FFormatDate write FFormatDate;
property FormatCurrency: string read FFormatCurrency write FFormatCurrency;
property ExportOnlyFieldsVisible: Boolean read FExportOnlyFieldsVisible write FExportOnlyFieldsVisible;
property ExportNullValues: Boolean read FExportNullValues write FExportNullValues;
property ExportNullAsEmptyString: Boolean read FExportNullAsEmptyString write FExportNullAsEmptyString;
property ExportEmptyDataSet: Boolean read FExportEmptyDataSet write FExportEmptyDataSet;
property ExportChildDataSetAsJsonObject: Boolean read FExportChildDataSetAsJsonObject write FExportChildDataSetAsJsonObject;
end;
constructor TDataSetSerializeConfigExport.Create;
begin
FExportNullValues := True;
FExportNullAsEmptyString:= False;
FExportOnlyFieldsVisible := True;
ExportEmptyDataSet := False;
FFormatCurrency := EmptyStr;
FFormatTime := 'hh:nn:ss.zzz';
FFormatDateTime := 'yyyy-mm-dd hh:nn:ss.zzz';
FFormatDate := 'YYYY-MM-DD';
FExportChildDataSetAsJsonObject := False;
end;
-- Export.pas
The text was updated successfully, but these errors were encountered: