viniciussanchez / dataset-serialize

JSON to DataSet and DataSet to JSON converter for Delphi and Lazarus (FPC)
MIT License
653 stars 161 forks source link

Date locale conversion issue in configuration sample #113

Closed Rollo62 closed 3 years ago

Rollo62 commented 3 years ago

Hi Vinicius,

in the "configuration" sample is an local issue, right when starting and populating the database. Since in Germany the date locale is "." instead of "/" I prepared a short workaround, see below:

`

 //S4: 22.09.21 Workaround for locale de-DE, with . instead of / for date strings
  if FormatSettings.DateSeparator = '.' then
  begin
      mtUsers.AppendRecord([1, 'Mateus Vicente', '13.04.1998', 14999.99]);
      mtUsers.AppendRecord([2, 'Vinicius Sanchez', '03.08.1995', Null]);
      mtUsers.AppendRecord([3, 'Julio Senha', '04.06.1985', 27000.00]);
      mtUsers.AppendRecord([4, 'Fagner Granela', Null, 105000.00]);
  end
  else
  begin
      mtUsers.AppendRecord([1, 'Mateus Vicente', '13/04/1998', 14999.99]);
      mtUsers.AppendRecord([2, 'Vinicius Sanchez', '03/08/1995', Null]);
      mtUsers.AppendRecord([3, 'Julio Senha', '04/06/1985', 27000.00]);
      mtUsers.AppendRecord([4, 'Fagner Granela', Null, 105000.00]);
  end;

`