mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-15 23:29:04 +02:00
* Better handling of empty dates
This commit is contained in:
parent
f6aa05353b
commit
0cffa26111
@ -878,25 +878,22 @@ function TCustomDBBootstrapTableWidget.MakeDateTimeRenderCol(aCol: TBootstrapTab
|
|||||||
DT : TDateTime;
|
DT : TDateTime;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if aTableCol.Formatting = '' then
|
if IsNull(Data) or isUndefined(Data) then
|
||||||
|
Result:=''
|
||||||
|
else if aTableCol.Formatting = '' then
|
||||||
Result := String(Data)
|
Result := String(Data)
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
if IsNull(Data) then
|
if Data is TJSDate then
|
||||||
|
Dt:=JSDateToDateTime(TJSDate(Data))
|
||||||
|
else if isString(Data) then
|
||||||
|
Dt:=ISO8601ToDate(String(Data),False)
|
||||||
|
else
|
||||||
|
Dt:=0;
|
||||||
|
if Dt<=100 then
|
||||||
Result:=''
|
Result:=''
|
||||||
else
|
else
|
||||||
begin
|
Result := FormatDateTime(aTableCol.Formatting, DT)
|
||||||
if Data is TJSDate then
|
|
||||||
Dt:=JSDateToDateTime(TJSDate(Data))
|
|
||||||
else if isString(Data) then
|
|
||||||
Dt:=ISO8601ToDate(String(Data),False)
|
|
||||||
else
|
|
||||||
Dt:=0;
|
|
||||||
if Dt<=100 then
|
|
||||||
Result:=''
|
|
||||||
else
|
|
||||||
Result := FormatDateTime(aTableCol.Formatting, DT)
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
if aTableCol.ExtraAttributes <> '' then
|
if aTableCol.ExtraAttributes <> '' then
|
||||||
Result := Format('<span %s>%s</span>', [ReplaceMoustache(row, aTableCol.ExtraAttributes), Result]);
|
Result := Format('<span %s>%s</span>', [ReplaceMoustache(row, aTableCol.ExtraAttributes), Result]);
|
||||||
|
Loading…
Reference in New Issue
Block a user