diff options
| -rw-r--r-- | Rakefile | 1 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/cell.rb | 4 | ||||
| -rw-r--r-- | test/drawing/tc_bar_3D_chart.rb | 2 |
3 files changed, 4 insertions, 3 deletions
@@ -10,6 +10,7 @@ end task :test do require 'rake/testtask' + puts "The current time is: #{Time.now}" Rake::TestTask.new do |t| t.libs << 'test' t.test_files = FileList['test/**/tc_*.rb'] diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index 6656428f..a32d19e7 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 - epoc1900 = Time.local(1900,1,1) - epoc1904 = Time.local(1904,1,1) + epoc1900 = Time.local(1900, 1, 1) + epoc1904 = Time.local(1904, 1, 1) epoc = Workbook.date1904 ? epoc1904 : epoc1900 ((v.localtime - epoc) /60.0/60.0/24.0).to_f elsif @type == :float diff --git a/test/drawing/tc_bar_3D_chart.rb b/test/drawing/tc_bar_3D_chart.rb index a198d197..ff01464c 100644 --- a/test/drawing/tc_bar_3D_chart.rb +++ b/test/drawing/tc_bar_3D_chart.rb @@ -6,7 +6,7 @@ class TestBar3DChart < Test::Unit::TestCase def setup @p = Axlsx::Package.new ws = @p.workbook.add_worksheet - @row = ws.add_row ["one", 1, Time.local("2011-1-1")] + @row = ws.add_row ["one", 1, Time.now] @chart = ws.add_chart Axlsx::Bar3DChart, :title => "fishery" end |
