summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-01-18 19:23:07 -0800
committerRandy Morgan <[email protected]>2012-01-18 19:23:07 -0800
commit8b9dc5f8c7f3189b8ea5d84d9dd53dc96a3c1d51 (patch)
treea41a6f331d324c7fa2248784f71059a1b5b3934f
parentcf2f67a6b5dc41cc0d90b3fa7917bb8cffa67b2e (diff)
parentf3ebd7851aa90b3073e181e2cc869f706339c950 (diff)
downloadcaxlsx-8b9dc5f8c7f3189b8ea5d84d9dd53dc96a3c1d51.tar.gz
caxlsx-8b9dc5f8c7f3189b8ea5d84d9dd53dc96a3c1d51.zip
Merge pull request #20 from ochko/master
date1904 need to be set on mac and freebsd
-rw-r--r--lib/axlsx/workbook/workbook.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/axlsx/workbook/workbook.rb b/lib/axlsx/workbook/workbook.rb
index edb02d81..ea733a4f 100644
--- a/lib/axlsx/workbook/workbook.rb
+++ b/lib/axlsx/workbook/workbook.rb
@@ -89,10 +89,15 @@ require 'axlsx/workbook/worksheet/worksheet.rb'
@drawings = SimpleTypedList.new Drawing
@charts = SimpleTypedList.new Chart
@images = SimpleTypedList.new Pic
- self.date1904= options[:date1904] unless options[:date1904].nil?
+ self.date1904= options[:date1904].nil? ? is_bsd? : options[:date1904]
yield self if block_given?
end
+ def is_bsd?
+ platform = RUBY_PLATFORM.downcase
+ platform.include?('freebsd') || platform.include?('darwin')
+ end
+
# Instance level access to the class variable 1904
# @return [Boolean]
def date1904() @@date1904; end