Expose typed data for dates and times
Currently they're just strings it would be nice if we could add support for exposing the type of these cells.
Yes you're right. I have to dig into the documentation to parse this properly but I do not have much time at the moment, perhaps you'd like to give it a try?
@tafia I am getting float value when trying to parse date-typed cell.
I have included the example xlsx: book.xlsx
@tafia the functions below (from xlsx-js) might be useful, maybe just implement that in rust?
I can give it a try if you don't mind 😜
Thanks! I'm a little busy at the moment, I'll try to make it as fast as possible. Feel free to make a PR!
I can give it a try if you don't mind 😜
I am starting to look at it but this is far from trivial. I really don't mind if you look at it 😄 .
Instead of having a calamine::DateTime struct, I'd prefer, if possible having some existing item:
- either
std::time::Instant - or
chrono::DateTime(not sure if it is overkill or not)?
What do you think?
I'd prefer unix timestamp (u64), cause it can be used in any time/date lib (e.g. chrono).
Looks good to me too!
Hi, Has anyone worked on this ticket? If not completely, can you share what you've figured out so far? I mean what exactly needs to be done to be able to parse date/time columns?
I had a look and having a perfect solution is not simple. Basically we need to parse the text format and decide upon it.
You can always have a look at https://github.com/SheetJS/js-xlsx implementation. It is not easy to read and I am not sure there is a one fits all solution (xlsb and xlsx will likely be different).
Is there anything left to do before this issue can be closed?