You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for taking the time to do this. I've merged the pull request because the errors were not at all related. It looks like it's some incompatibility issue with jruby 1.7. The tests run fine under jruby 1.6.8.
Thanks for merging it in, Scott! Sorry to hear about the 1.7 incompat pain.
Sorry that I muddled the issues. Regarding POI being unable to return a time.... what do you think would be the best way to handle it? Excel doesn't have any native type to distinguish between a date and a datetime, they're all stored as datetimes. I think a few options include:
Do nothing. This is bad because
Config variable. This is good because it allows people to preserve existing behavior.
If the time ends with 00:00:00 (the numeric date value ends with .0), then return a date. (this can be bad, because it would leave the programmer with a bit of an inconsistent type)
Always return a Time, but have an optional parameter to value to tell it to return a date. I think this is my preferred approach, but could be a breaking change for some.
Just always return a Time. If the programmer wants a date, they should sign up for match.com, or implement Time#to_date.
If you create an excel spreadsheet (xls) from the following csv:
Then load it with jruby-poi, and access the cell with the date, you will get a Date with "2006-12-31"
The problematic code is here:
https://github.com/kameeoze/jruby-poi/blob/master/lib/poi/workbook/cell.rb#L168
Changing Date.parse to Time.parse seems like a safe bet.
The text was updated successfully, but these errors were encountered: