fpspreadsheet: Fix TsWorksheet not being able to change a time cell value (see https://forum.lazarus.freepascal.org/index.php/topic,42130.msg293480)

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6569 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-08-04 17:31:51 +00:00
parent 31e59a76e1
commit a261ff7999

View File

@ -5208,15 +5208,15 @@ begin
// "1" as a valid date/time.
if TryStrToDateTime(AValue, number, AFormatSettings) then
begin
if number < 1.0 then // this is a time alone
begin
if not IsTimeFormat(numFmtParams) then
if (number < 1.0) or IsTimeFormat(numFmtParams) then // this is a time alone
begin
// if not IsTimeFormat(numFmtParams) then
// begin
ucValue := Uppercase(AValue);
isAMPM := (pos('AM', ucValue) > 0) or (pos('PM', ucValue) > 0);
isLongTime := IsLongTimeFormat(AValue, AFormatSettings.TimeSeparator);
WriteDateTime(ACell, number, TIME_FMT[isAMPM, isLongTime]);
end;
// end;
end else
if frac(number) = 0.0 then // this is a date alone
begin