-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Time cells not properly shown #19
Comments
I just tested the end of [...]
task :example do
require 'rodf'
RODF::Spreadsheet.file("example.ods") do
table 'table1' do
row do
cell Time.now
end
end
end
end The After some investigations I achieved to correctly display Date & Time values with this modification on [...]
unless empty?(@value)
@url = opts[:url]
if !@type
if @value.is_a?(Numeric)
@type = :float
elsif @value.respond_to?(:strftime)
@type = :date
else
@type = :string
@value = @value.to_s
end
end
case @value.class.name
when 'Date'
@value = @value.strftime("%Y-%m-%d") if @value.respond_to?(:strftime)
when 'Time'
@value = @value.strftime("%Y-%m-%dT%T") if @value.respond_to?(:strftime)
end
end
[...] If you want I can prepare a pull request with this modification & some specs in the following week. (edit) disclaimer : the discussion started here westonganger/spreadsheet_architect#14 |
Unfortunately that solution doesn't seem correct. However I fixed the time format and added a fix for DateTime objects. Please test again with the latest commit on |
We're you able to test the latest commit? |
Sorry for the delay. |
I see |
I was unsuccessful in my attempts to resolve this issue. If anyone wants to tackle this I would be happy to accept/collaborate on a PR. The relevant method is Until this is resolved, I am recommending that all dates/times be passed as strings instead. |
A workaround might be to manually calculate to fraction of the day like this: |
Time cells are not being properly shown in v1.0.0
Fix in progress on develop branch.
The text was updated successfully, but these errors were encountered: