diff options
| author | Randy Morgan <[email protected]> | 2011-11-29 20:07:44 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2011-11-29 20:07:44 +0900 |
| commit | 3cd46c72882d3bb42bc46b67dbc12cbd805d0c4f (patch) | |
| tree | c6f028c32eda589d0a16bf7565f6931ce587e3c8 /lib | |
| parent | a61e58efc3055f51019c26d7853bf227a33d20b2 (diff) | |
| download | caxlsx-3cd46c72882d3bb42bc46b67dbc12cbd805d0c4f.tar.gz caxlsx-3cd46c72882d3bb42bc46b67dbc12cbd805d0c4f.zip | |
trying to fix 'out of range' for time creation on travis
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/cell.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index 0d15721b..3babefa2 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -169,8 +169,8 @@ module Axlsx def cast_value(v) if (@type == :time && v.is_a?(Time)) || (@type == :time && v.respond_to?(:to_time)) v = v.respond_to?(:to_time) ? v.to_time : v - epoc = Workbook.date1904 ? Time.local(1904,1,1,0,0,0,0,v.zone) : Time.local(1900,1,1,0,0,0,0,v.zone) - ((v - epoc) /60.0/60.0/24.0).to_f + epoc = Workbook.date1904 ? Time.local(1904,1,1,0,0,0,0) : Time.local(1900,1,1,0,0,0,0) + ((v.localtime - epoc) /60.0/60.0/24.0).to_f elsif @type == :float v.to_f elsif @type == :integer |
