You've already forked lazarus-ccr
* TsWorksheet.ReadAsUTF8Text: readasdate also reads time values unless sure cell is date-only. Thanks wp for the suggestions!
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2861 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -689,11 +689,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
case ACell^.ContentType of
|
case ACell^.ContentType of
|
||||||
|
|
||||||
//cctFormula
|
//cctFormula
|
||||||
cctNumber: Result := FloatToStrNoNaN(ACell^.NumberValue);
|
cctNumber: Result := FloatToStrNoNaN(ACell^.NumberValue);
|
||||||
cctUTF8String: Result := ACell^.UTF8StringValue;
|
cctUTF8String: Result := ACell^.UTF8StringValue;
|
||||||
cctDateTime: Result := SysUtils.DateToStr(ACell^.DateTimeValue);
|
cctDateTime:
|
||||||
|
begin
|
||||||
|
Result := SysUtils.DateToStr(ACell^.DateTimeValue);
|
||||||
|
// User can have specified custom date/time format or one of the other built
|
||||||
|
// in formats that include time. We can't parse all of them so just return
|
||||||
|
// time as well unless absolutely sure we only want a date
|
||||||
|
if ACell^.NumberFormat<>nfShortDate then
|
||||||
|
Result := Result+' ' + SysUtils.TimeToStr(ACell^.DateTimeValue);
|
||||||
|
end;
|
||||||
else
|
else
|
||||||
Result := '';
|
Result := '';
|
||||||
end;
|
end;
|
||||||
|
Reference in New Issue
Block a user