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
Our dates are in a format that is getting incorrectly parsed by the default parsing strategies.
Our date format is y-mmm, e.g. "16-Aug" for month of August, no day, year 2016
Roo/Roo-xls give us a Date object for 2017-08-16 for month of August, day 16, year 2017
In Roo for .xlsx files, we've been using the #formatted_value method as a workaround. It reformats the date object which essentially gives us the underlying string.
sheet.formatted_cell(1,1) => "16-AUG"
The #formatted_value method is a bit of a hacky workaround but is serving us well enough. But there seems to be no way to get the underlying string representation of a Date, Time, or DateTime field for .xls files in roo-xls.
The text was updated successfully, but these errors were encountered:
I had a similar problem where I entered a date like 6/1/2024 in excel spreadsheet in an xlsx file but the date became some big digit 45297 which is actually an offset from 30 Dec 1899. so, you could build a date object or time object if you have an number which represents the object like the following:
after that you could just use the Date and Time class of Ruby and related methods to do what you want.
N.B: the offset_number can be an integer or a float. and 86400 is just the seconds in a day so, offset_number 0.5 multiplied by 86400 would give you 12pm for a Time object using the offset number from the beginning of some day.
Our dates are in a format that is getting incorrectly parsed by the default parsing strategies.
Our date format is y-mmm, e.g. "16-Aug" for month of August, no day, year 2016
Roo/Roo-xls give us a Date object for 2017-08-16 for month of August, day 16, year 2017
In Roo for
.xlsx
files, we've been using the#formatted_value
method as a workaround. It reformats the date object which essentially gives us the underlying string.The
#formatted_value
method is a bit of a hacky workaround but is serving us well enough. But there seems to be no way to get the underlying string representation of a Date, Time, or DateTime field for.xls
files in roo-xls.The text was updated successfully, but these errors were encountered: