diff --git a/components/fpspreadsheet/fpsopendocument.pas b/components/fpspreadsheet/fpsopendocument.pas index 9bf4df894..ab6b0cb7b 100755 --- a/components/fpspreadsheet/fpsopendocument.pas +++ b/components/fpspreadsheet/fpsopendocument.pas @@ -49,6 +49,7 @@ type procedure ReadFormula(ARow : Word; ACol : Word; ACellNode: TDOMNode); procedure ReadLabel(ARow : Word; ACol : Word; ACellNode: TDOMNode); procedure ReadNumber(ARow : Word; ACol : Word; ACellNode: TDOMNode); + procedure ReadDate(ARow : Word; ACol : Word; ACellNode: TDOMNode); end; { TsSpreadOpenDocWriter } @@ -214,7 +215,9 @@ begin else if ParamFormula<>'' then ReadFormula(Row+RowsCount,Col+ColsCount,CellNode) else if ParamValueType='float' then - ReadNumber(Row+RowsCount,Col+ColsCount,CellNode); + ReadNumber(Row+RowsCount,Col+ColsCount,CellNode) + else if ParamValueType='date' then + ReadDate(Row+RowsCount,Col+ColsCount,CellNode); end; //for ColsCount end; //for RowsCount @@ -265,6 +268,16 @@ begin end; end; +procedure TsSpreadOpenDocReader.ReadDate(ARow: Word; ACol : Word; ACellNode : TDOMNode); +var + Value: String; + dt:TDateTime; +begin + Value:=GetAttrValue(ACellNode,'office:date-value'); + dt:=StrToDate(Value,'yyyy-mm-dd','-'); + FWorkSheet.WriteDateTime(Arow,ACol,dt); +end; + { TsSpreadOpenDocWriter } procedure TsSpreadOpenDocWriter.WriteMimetype;