Method: Rods#setDateFormat

Defined in:
lib/rods.rb

#setDateFormat(formatName) ⇒ Object

Convenience-function to switch the default-style for the display of date-values. The switch is valid for all subsequently created cells with date-values.

Builtin valid values are

  • ‘myDate’

    • -> “02.01.2011” (German formatting)

  • ‘myDateDay’

    • -> “Su”

Example

mySheet.setDateFormat("myDateDay")  # RODS' default format for display of weekday
mySheet.setDateFormat("myDate")     # RODS' default format for date ("12.01.2011" German format)



92
93
94
95
96
97
98
# File 'lib/rods.rb', line 92

def setDateFormat(formatName)
  case formatName
    when "myDate" then @dateStyle="myDate"
    when "myDateDay" then @dateStyle="myDateDay"
    else die("setDateFormat: invalid format-name #{format}")
  end
end