Class: RubyXL::NumberFormat

Inherits:
OOXMLObject show all
Defined in:
lib/rubyXL/objects/stylesheet.rb

Overview

Instance Attribute Summary

Attributes included from OOXMLObjectInstanceMethods

#local_namespaces

Instance Method Summary collapse

Methods included from OOXMLObjectInstanceMethods

#==, #before_write_xml, included, #index_in_collection, #initialize, #write_xml

Instance Method Details

#is_date_format?Boolean

Returns:

  • (Boolean)


16
17
18
19
# File 'lib/rubyXL/objects/stylesheet.rb', line 16

def is_date_format?
  #             v-------- Toss all the escaped chars -------v v--- and see if any date-related remained
  !!(format_code.gsub(/(\"[^\"]*\"|\[[^\]]*\]|[\\_*].)/i, '') =~ /[dmyhs]/i)
end