class InoxConverter::DateFormat
Public Instance Methods
formatDate(value, unit)
click to toggle source
# File lib/inox_converter/date_format.rb, line 16 def formatDate(value, unit) date = getInDictionary(unit) newDate = value.strftime(date) return newDate end
initDictionary()
click to toggle source
use values from en.wikipedia.org/wiki/Date_format_by_country
# File lib/inox_converter/date_format.rb, line 7 def initDictionary @dictionary = Hash.new @dictionary = { "DMY" => "%d/%m/%Y", "YMD" => "%Y/%m/%d", "MDY" => "%m/%d/%Y" } end