mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 12:09:21 +02:00
LazReport: Support FormatStr with brackets (e.g. [h]:mm) in DateTime fields. Issue #34713, patch from Bartek Dajewski.
git-svn-id: trunk@60709 -
This commit is contained in:
parent
fcdd4db4dc
commit
b3a6d22921
@ -10133,7 +10133,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
Result := TimeToStr(v);
|
Result := TimeToStr(v);
|
||||||
if Result='' then
|
if Result='' then
|
||||||
Result := FormatDateTime('hh:nn:ss', v);
|
Result := FormatDateTime('hh:nn:ss', v, [fdoInterval]);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Result := v;
|
Result := v;
|
||||||
@ -10159,14 +10159,14 @@ begin
|
|||||||
Result := '' // date is null
|
Result := '' // date is null
|
||||||
else
|
else
|
||||||
if f2 = 4 then
|
if f2 = 4 then
|
||||||
Result := SysToUTF8(FormatDateTime(AFormatStr, v))
|
Result := SysToUTF8(FormatDateTime(AFormatStr, v, [fdoInterval]))
|
||||||
else
|
else
|
||||||
Result := FormatDateTime(frDateFormats[f2], v);
|
Result := FormatDateTime(frDateFormats[f2], v, [fdoInterval]);
|
||||||
fmtTime:
|
fmtTime:
|
||||||
if f2 = 4 then
|
if f2 = 4 then
|
||||||
Result := FormatDateTime(AFormatStr, v)
|
Result := FormatDateTime(AFormatStr, v, [fdoInterval])
|
||||||
else
|
else
|
||||||
Result := FormatDateTime(frTimeFormats[f2], v);
|
Result := FormatDateTime(frTimeFormats[f2], v, [fdoInterval]);
|
||||||
fmtBoolean :
|
fmtBoolean :
|
||||||
begin
|
begin
|
||||||
if f2 = 4 then
|
if f2 = 4 then
|
||||||
@ -12586,7 +12586,7 @@ begin
|
|||||||
0: dk := dkAvg; //Add('AVG'); {0}
|
0: dk := dkAvg; //Add('AVG'); {0}
|
||||||
1: dk := dkCount; //Add('COUNT'); {1}
|
1: dk := dkCount; //Add('COUNT'); {1}
|
||||||
2: val := DayOf(frParser.Calc(p1)); //Add('DAYOF'); {2}
|
2: val := DayOf(frParser.Calc(p1)); //Add('DAYOF'); {2}
|
||||||
3: val := FormatDateTime(frParser.Calc(p1), frParser.Calc(p2)); //Add('FORMATDATETIME'); {3}
|
3: val := FormatDateTime(frParser.Calc(p1), frParser.Calc(p2), [fdoInterval]); //Add('FORMATDATETIME'); {3}
|
||||||
4: val := FormatFloat(frParser.Calc(p1), lrVarToFloatDef(frParser.Calc(p2))); //Add('FORMATFLOAT'); {4}
|
4: val := FormatFloat(frParser.Calc(p1), lrVarToFloatDef(frParser.Calc(p2))); //Add('FORMATFLOAT'); {4}
|
||||||
5: val := FormatMaskText(frParser.Calc(p1) + ';0; ', frParser.Calc(p2)); //Add('FORMATTEXT'); {5}
|
5: val := FormatMaskText(frParser.Calc(p1) + ';0; ', frParser.Calc(p2)); //Add('FORMATTEXT'); {5}
|
||||||
6:begin //Add('INPUT'); {6}
|
6:begin //Add('INPUT'); {6}
|
||||||
|
Loading…
Reference in New Issue
Block a user