spout
spout copied to clipboard
setShouldFormatDates(false) Bug?
Following on from #481, I still think there is a need for returning raw cell data.
The attached xlsx has a cell C2 with a custom format which is is incorrectly recognised as a date.
The cell has a value 1
formatted to look like 1 ST
, spout returns this as:
{ "date": "1900-01-01 00:00:00", "timezone_type": 3, "timezone": "UTC" },
Presumably becuase it thinks it's getting a date starting with: 1st ....
?
If I use $reader->setShouldFormatDates(true);
then spout returns:
#,##0 ST
Neither is correct. If I had the option to return raw cell data I could at least extract a value of 1
and work with that.
using "box/spout": "^2.7",
I have the exact same issue when reading an excel file. Did you come up with a solution @devops-at-alinea?
I also agree with you, this nice library should have a "return raw cell data" option.
@melihyenel You should not need such an option if the library returns you the right data :)
@devops-at-alinea What do you expect Spout to return? If the cell has a timestamp value set to 1
, it's normal that it returns { "date": "1900-01-01 00:00:00", "timezone_type": 3, "timezone": "UTC" }
.
When setting $reader->setShouldFormatDates(true);
, you expect Spout to return "1 ST" right?
Spout does not seem to be able to interpret the #,##0
part... I need to look into this
@adrilo I omitted to mention that the 1 ST is actually a measure of quantity, ST stands for Stück which I believe means per piece.
So the cell doesn't have a timestamp value of 1, it simply has a value of 1 and a custom format #,##0 "ST" so I would expect Spout to return 1 ST