#1 Yesterday 12:16:16

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 576

Question concerning JSON generation DateTime -> Null

Hi Arnaud, since 3Month or so JSON Output write null for TDateTime if Date is 0
Before it wrotes a empty String "" in JSON Output.

Is it possible to enable old Feature OnDemand ?
Because we have old SynCrossplatform Clients throwing exception implicit converting Variant Null to String

For new Clients i added this to SynCrossplatformJSON:

function Iso8601ToDateTime(const Value: Variant): TDateTime; overload;
function Iso8601ToDateTime(const Value: string): TDateTime; overload;

Last edited by itSDS (Yesterday 12:17:02)


Rad Studio 12.3 Athens / 13.0 Ganymede

Offline

#2 Yesterday 18:12:59

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,161
Website

Re: Question concerning JSON generation DateTime -> Null

I understand your concern.

Please try with
https://github.com/synopse/mORMot2/commit/1c9175125

Sorry for the breaking change.
It was a user request, and I did not think about breaking legacy clients.

Online

#3 Today 07:21:30

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 576

Re: Question concerning JSON generation DateTime -> Null

Looks good, TYVM

one thing: in mormot.ui.pdf the unit   mormot.crypt.other, is missing !


Rad Studio 12.3 Athens / 13.0 Ganymede

Offline

#4 Today 07:37:03

itSDS
Member
From: Germany
Registered: 2014-04-24
Posts: 576

Re: Question concerning JSON generation DateTime -> Null

One Question where can i set this Option globally ?


Rad Studio 12.3 Athens / 13.0 Ganymede

Offline

#5 Today 08:08:15

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 15,161
Website

Re: Question concerning JSON generation DateTime -> Null

Did you try to add it to the global DEFAULT_WRITEOPTIONS[] variable?

I have fixed the ui.pdf compilation.
Thanks for the notice.

Online

Board footer

Powered by FluxBB