Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Writer doesn't support writing DateTime objects #751

Closed
guss77 opened this issue Jun 8, 2020 · 2 comments
Closed

Writer doesn't support writing DateTime objects #751

guss77 opened this issue Jun 8, 2020 · 2 comments

Comments

@guss77
Copy link
Contributor

guss77 commented Jun 8, 2020

According to Box\Spout\Common\Entity\Cell, a DateTime object is a valid cell value, and it is correctly assigned the type TYPE_DATE. But it seems the writer implementations do not support it: when trying to write a sheet that contains a TYPE_DATE cell, the writer throws Box\Spout\Common\Exception\InvalidArgumentException: Trying to add a value with an unsupported type: object

(Happened in ODS writer but the code looks similar for XLS and looks like CSV just tries to stringify all the cells, which will not work because DateTime does not have a __toString() method).

@ChronicLogic
Copy link

I added a PR #781 for XLSX, I had addressed this separately, unaware that there was an issue with ODS or CSV. Whoever (if anyone) would integrate the PRs should look at all of the cases.

@adrilo
Copy link
Collaborator

adrilo commented May 14, 2021

Duplicates #662

@adrilo adrilo closed this as completed May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants