Losing cell format when writing from reader (Ods) #2938
-
Hello, would like to know if the behaviour of following example is desired or if it is a bug. I have an ods file with a date formatted cell. I load this file with the ods reader and then add a value to another cell (doesn't matter). Now i construct a writer and would like to save the data. If i open the saved file with an office suite, the date formatted cell is now a floating point number in a float typed field (also looked directly into the xml). I did a deep dive into the reader and writer. The writer has limitation about what type can be processed to the file. The date type can not be processed, same as with time etc.. The reader converts the date type to a float and sets the type to number type ('n'). With this in mind, this seems not to be a bug but also, for me, not the expected behaviour. Can you confirm my thoughts about it? And if yes, is this just lack of implementation or has this a technical reason? Example: $reader = new OdsFileReader();
$spreadsheet = $reader->load($filePath);
// do some changes to worksheet
$writer = new OdsFileWriter($spreadsheet);
$writer->save('path'); Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Dates/Times are always a MS Serialized Timestamp value internally; and the Ods reader reads and interprets this correctly, converting it to the correct numeric representation for that date. What isn't fully implemented is reading the format mask for the value (the code just uses a generic date/time format mask when reading), or writing with the correct format mask |
Beta Was this translation helpful? Give feedback.
Dates/Times are always a MS Serialized Timestamp value internally; and the Ods reader reads and interprets this correctly, converting it to the correct numeric representation for that date. What isn't fully implemented is reading the format mask for the value (the code just uses a generic date/time format mask when reading), or writing with the correct format mask