* Reset default to RFC3339 date handling if no format specified

This commit is contained in:
michael 2019-05-20 18:56:26 +00:00
parent 0a0fd7dfe0
commit c5d66bd192

View File

@ -1092,7 +1092,6 @@ begin
Result:=Null
else
Result:=FormatDateTimeField(aValue,aField)
end;
@ -1557,15 +1556,9 @@ begin
Ptrn:=(F as TJSONDateTimeField).DateTimeFormat;
end;
If (Ptrn='') then
Case F.DataType of
ftDate : Result:=StrToDate(S);
ftTime : Result:=StrToTime(S);
ftDateTime : Result:=StrToDateTime(S);
end
Result := DefaultConvertToDateTime(F,S,True)
else
begin
Result:=ScanDateTime(ptrn,S,1);
end;
end;
function TBaseJSONDataSet.FormatDateTimeField(DT: TDateTime; F: TField
@ -1585,11 +1578,7 @@ begin
Ptrn:=TJSONDateTimeField(F).DateTimeFormat;
end;
If (Ptrn='') then
Case F.DataType of
ftDate : Result:=DateToStr(DT);
ftTime : Result:=TimeToStr(DT);
ftDateTime : Result:=DateTimeToStr(DT);
end
Result := DateTimeToRFC3339(DT)
else
Result:=FormatDateTime(ptrn,DT);
end;