diff options
| author | Randy Morgan <[email protected]> | 2011-11-29 15:01:39 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2011-11-29 15:01:39 +0900 |
| commit | be6d974840b8f59624c6f6ed0dcfa8a2e7c791af (patch) | |
| tree | 95be55833d2c576ef3667ff53475cb39a7fb56cc /lib | |
| parent | 25a73b821d4234e0a435fbee07f449c1a15ea1f4 (diff) | |
| download | caxlsx-be6d974840b8f59624c6f6ed0dcfa8a2e7c791af.tar.gz caxlsx-be6d974840b8f59624c6f6ed0dcfa8a2e7c791af.zip | |
patch for 1.8.3 lack of to_time support on Time
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/workbook/worksheet/cell.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index 716b75a4..0d15721b 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -168,7 +168,7 @@ module Axlsx # @see Axlsx#date1904 def cast_value(v) if (@type == :time && v.is_a?(Time)) || (@type == :time && v.respond_to?(:to_time)) - v = v.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 elsif @type == :float |
