* Better handling of empty dates

This commit is contained in:
Michaël Van Canneyt 2024-01-14 14:48:01 +01:00
parent f6aa05353b
commit 0cffa26111

View File

@ -878,12 +878,10 @@ function TCustomDBBootstrapTableWidget.MakeDateTimeRenderCol(aCol: TBootstrapTab
DT : TDateTime;
begin
if aTableCol.Formatting = '' then
Result := String(Data)
else
begin
if IsNull(Data) then
if IsNull(Data) or isUndefined(Data) then
Result:=''
else if aTableCol.Formatting = '' then
Result := String(Data)
else
begin
if Data is TJSDate then
@ -897,7 +895,6 @@ function TCustomDBBootstrapTableWidget.MakeDateTimeRenderCol(aCol: TBootstrapTab
else
Result := FormatDateTime(aTableCol.Formatting, DT)
end;
end;
if aTableCol.ExtraAttributes <> '' then
Result := Format('<span %s>%s</span>', [ReplaceMoustache(row, aTableCol.ExtraAttributes), Result]);
end;