summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2011-11-30 07:52:46 +0900
committerRandy Morgan <[email protected]>2011-11-30 07:52:46 +0900
commit4fcf75ff45cb3f5265aec534bf2f6a02ebebc4a9 (patch)
treef7194e4afa01bd2917bcb0c4112f47410115aa06
parent6267d20703af8cdd3bed97ff5b71b4faa4dd2232 (diff)
downloadcaxlsx-4fcf75ff45cb3f5265aec534bf2f6a02ebebc4a9.tar.gz
caxlsx-4fcf75ff45cb3f5265aec534bf2f6a02ebebc4a9.zip
Output time in rake test to see what time travis thinks it is.
-rw-r--r--Rakefile1
-rw-r--r--lib/axlsx/workbook/worksheet/cell.rb4
-rw-r--r--test/drawing/tc_bar_3D_chart.rb2
3 files changed, 4 insertions, 3 deletions
diff --git a/Rakefile b/Rakefile
index 12ec6a52..f2091830 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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